Polyline label


DenisePac
 Share

Go to solution Solved by Kbird1,

Recommended Posts

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

  • Solution
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

 

 

image.thumb.png.29f7fd71d0ab7bb744622c9a38361908.png

 

 

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

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share