Double Door Labels


NestNZ
 Share

Recommended Posts

Hello,

 

I'm trying to find out a way of creating a label for a set of Double doors that divides the total width of the door to show how big each door is. ie 

not that it's a 1420mm wide doorway, but it's 2/ 710 doors.  


Is it possible to write a rich text/or custom label using the DBX to show the individual leaf sizes of the doors. Ie

Something along the lines of 2/ (%FORMATTEDNEARESTWIDTH%/2) if it was an excel formula?

 

Is there a list of "specify label " or rich text format syntax to get the desired results?

 

Thanks,

Tim

 

 

 

 

Link to comment
Share on other sites

HI Eric, awesomely quick reply, thanks.

 

I didn't know about Ruby and Macros - though suspect I will shortly!  

 

Had a quick play with your 'suggested' width syntax, and after inserting that in the label from user defined, then adding the 'plain text' in front of the macro's formula answer gets it pretty close.  Just need to figure out how to get rid of the decimal point - 2/ 500.0  . Would like to go to 2/ 500.  

 

image.thumb.png.9d0389bf3fc02393ae4be6920508569b.png

 

Glenn, yeah, that's a bit of a mouthful!

 

To both thanks for the screenshots/snips.  Gotta love that tool!

Link to comment
Share on other sites

I always recommend extreme caution when converting numbers to integers.  First off, it rounds all numbers down, so 3.99 becomes 3.  Secondly, it can be extremely problematic if you use those results in any further calculations...not only because it rounds numbers down, but more specifically because it rounds values less than 1 down to zero.  This is especially problematic when any multiplication or division is involved because the results will either be zero or an error. 

 

What I recommend people use instead is the .round method which simply rounds to the nearest whole number when no argument is given (such as in .round(2) which would round to 2 decimal places), .ceil which rounds the number up to the nearest whole number, or .floor which rounds the number down to the nearest whole number.  I find that there are very few instances where .to_i is the best method.  Just my 2 cents.  

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