# Polyline label

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.

##### Share on other sites

Everything you need to know is scattered around the forum.

See if this gets you started.

##### 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 :

this PDF is some more info gleaned here on the Forum on the New Number Formatter option to use with     .to_xx_xx '

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 :

# ++++++++++++++++++++++++++++++++
# Eric's simpler non- Global Macro
# ++++++++++++++++++++++++++++++++

#Macro Start

nf = NumberFormatter.new

nf.unit = '\'-"'

nf.use_fractions = true

nf.apply(perimeter)

Thank you!!