DenisePac Posted July 18, 2021 Share Posted July 18, 2021 I use closed polylines to measure perimeter lf for assisting with estimating materials. The polyline’s object specification for the number style is set for feet, fractional inches. However, the number style for the corresponding polyline label is defaulting to only fractional inches. For the polyline label, I am using the object specific macro for %perimeter and want the label to display the perimeter as feet, fractional inches. How do I change that? thanks. Link to comment Share on other sites More sharing options...
Solution Kbird1 Posted July 18, 2021 Solution Share Posted July 18, 2021 4 hours ago, DenisePac said: want the label to display the perimeter as feet, fractional inches. How do I change that? You need to convert the Inches with a Macro , in X12 and X13 we have the Number.Formatter.New technique now , which I believe is what Eric is referring you too. here is the quick play I had, not sure how elegant it is but it works..... just import it into TMM and then insert into the Polyline Label : MHD Polyline Perimeter Label.json this PDF is some more info gleaned here on the Forum on the New Number Formatter option to use with .to_xx_xx ' CA Ruby Measurement Class and New Number Formatter.pdf Mick. Macro - Text Only: #Define Number Formatter in Feet-Inch $NF = NumberFormatter.new $NF.unit = '\'-"' $NF.use_fractions = true def fi(n) end # Macro Start n = (perimeter.to_ft).round(2) $NF.apply(n) --------------------------------------------------------------------- *** Eric was kind enough to point out that in this case we don't need a Global New Number , so the Code would be : Solver Polyline Perimeter Label.json # ++++++++++++++++++++++++++++++++ # Eric's simpler non- Global Macro # ++++++++++++++++++++++++++++++++ #Macro Start nf = NumberFormatter.new nf.unit = '\'-"' nf.use_fractions = true nf.apply(perimeter) Link to comment Share on other sites More sharing options...
DenisePac Posted July 18, 2021 Author Share Posted July 18, 2021 Thank you!! 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