Polyline Default Setting for Label


Michael_Gia
 Share

Go to solution Solved by Chopsaw,

Recommended Posts

22 minutes ago, Michael_Gia said:

"sq ft"

I should not be responding to this but only a few of our macro gurus respond to stuff nowadays. Assume that I may be completely wrong, I am not familiar with using the correct terminology

I believe in X-13 they built in a custom classification for anything that would be considered a dimension. Which means to use an area macro you may have to convert it to a float. by using .to_f

Link to comment
Share on other sites

6 minutes ago, Chopsaw said:

 

Something like this perhaps ?  My French is a little rusty.

 

image.thumb.png.769041ff0cdc6ea1ff8a59643c6cfa10.png

 

 

Yes, that's what I was able to do as well except I loose the comma separator.

 

If you uncheck "use default formatting" you lose the comma.

 

...and yes, I was trying to get sq.ft. in French, lol 

Link to comment
Share on other sites

2 minutes ago, Michael_Gia said:

Thanks Chopsaw, but I wasn't able to get that to work.

I must have a typo or something. 

 

Yes even spaces are critical but I deleted mine.   Try it one more time and I will recreate if necessary.

  • Upvote 1
Link to comment
Share on other sites

4 minutes ago, Chopsaw said:

 

Yes even spaces are critical but I deleted mine.   Try it one more time and I will recreate if necessary.

It works, just need to round out the decimal places to 0.

I thought by entering in, area.round(0) would give me no decimal places but it just adds .00

 

Link to comment
Share on other sites

%area%, %width%, %height%, etc) return measurement values according to the current Plan (Imperial or Metric).

 

To get the units to show you just need to convert the output to a "string" as follows:

  • %area.round(2).to_s%  -> 1419.25 sq ft
  • %width.round(2).to_s% -> 62.5 in

Note that it's possible to change the units using the "Formatter" class.

  • Upvote 1
Link to comment
Share on other sites

2 hours ago, Joe_Carrick said:
  • %area.round(2).to_s.gsub("sq ft","pi.ca")%  -> 1419.25 pi.ca

I don't think Chief will use French wording or abbreviations.  So you need to make the "substitution" yourself.

 

They should maybe think of that since their marketing team is going international.

 

7 hours ago, Joe_Carrick said:

To get the units to show you just need to convert the output to a "string" as follows:

  • %area.round(2).to_s%  -> 1419.25 sq ft

 

It is interesting in your example above that it does not follow the same default formatting as you get when you select "Use Default Formatting" for a label display, as when you tell it to display as a string. That seems to be more than just a little bit inconsistent.

 

That really should have the default thousand's separator, should it not ?   That is why I dumped the formatting all together and put what was required back in manually even though it is not a clean as I would have liked.

 

This may have been a little better but still fails under 1,000

 

%area.round.to_s.insert(-10,",").gsub("sq ft"," pi.ca")%

Link to comment
Share on other sites

I don't use any custom units since I am not doing projects that require it.

 

However, it is possible to create unit conversions using the Preferences>General>Unit Conversions dialog.  These named units can then be used in Dimension Defaults, as well as in various dialogs.  It's possible to set these custom units up so that they are the "Default Formatting" with specific 1000ths separators and decimal separators and unit names.  When used in dialogs, the input will recognize the custom unit.

 

This is really a great way to customize Chief for other languages.  Note that "Custom Units" will automatically display the units while the built-in units require the ".to_s" as I indicated previously.

 

For those who want to use these features you should search Help for "Unit Conversions" and "Number Formatting Class".   It's a little complicated but once done it will be available for all Plans.

  • Like 1
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