ComputerMaster86 Posted May 5, 2017 Share Posted May 5, 2017 Would some be willing to tell me what the ruby code is for working with area of a polyline? internal_area <-- I don't believe this is it. Thank you all in advanced. Link to comment Share on other sites More sharing options...
ComputerMaster86 Posted May 5, 2017 Author Share Posted May 5, 2017 Well I am trying to round the area two to decimal places. Link to comment Share on other sites More sharing options...
ComputerMaster86 Posted May 5, 2017 Author Share Posted May 5, 2017 I can't seam to get area.round(2) to work. I wonder if I need to name the macro a special name? Link to comment Share on other sites More sharing options...
Joe_Carrick Posted May 5, 2017 Share Posted May 5, 2017 Create a new macro named "Area.rounded" Check "Evaluated" Select Context "Owner" enter the following in the macro result = area.round(2).to_s insert that macro in the Polyline Label. Link to comment Share on other sites More sharing options...
ComputerMaster86 Posted May 5, 2017 Author Share Posted May 5, 2017 Thank you all so much. I feel like my next steel re-roof job is going to be ten times easier once I set up all of my macros. Link to comment Share on other sites More sharing options...
Joe_Carrick Posted May 5, 2017 Share Posted May 5, 2017 1 hour ago, solver said: Joe: Is the string conversion really needed, or just the proper way to do it -- like explicitly assigning a value to result. Eric, I do that so the it's easy to add (concatenate) the result. example: result = area.round(2).to_s + " sq.ft." result = "Area = " + result or, if you want to perform some other calculations: x = area.round(2) result = "Area = " + x.to_s + " sq.ft." There are other ways of coding to get the same result. Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now