NestNZ Posted June 13, 2019 Share Posted June 13, 2019 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 More sharing options...
glennw Posted June 13, 2019 Share Posted June 13, 2019 The included Object Specific, Formatted Size macro will give you this, but I am guessing you probably don't wand the thickness. (and the spacings are bit off) Link to comment Share on other sites More sharing options...
NestNZ Posted June 13, 2019 Author Share Posted June 13, 2019 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. 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 More sharing options...
glennw Posted June 13, 2019 Share Posted June 13, 2019 Easiest way is to just type it into the label box. Link to comment Share on other sites More sharing options...
NestNZ Posted June 13, 2019 Author Share Posted June 13, 2019 Easiest way, but not neccessarily quickest! I had hoped to have it set up either as a default, or library item to streamline that process Link to comment Share on other sites More sharing options...
NestNZ Posted June 13, 2019 Author Share Posted June 13, 2019 From ultra quick look at ruby material, it seems that it would be possible to get the label looking like we want it too. With some learning time... Link to comment Share on other sites More sharing options...
NestNZ Posted June 13, 2019 Author Share Posted June 13, 2019 Nice. Thank you very much Eric. Link to comment Share on other sites More sharing options...
Alaskan_Son Posted June 13, 2019 Share Posted June 13, 2019 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. 1 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