Libraries & objects
About Archicad and BIMcloud libraries, their management and migration, objects and other library parts, etc.

How to set Working Units within a label

kevin b
Contributor
I modified a simple label to read a particular parameter of an object, in this case the mounting height. I am getting the label to read the correct height, however it is showing in meters rather than inches.

So if the mounting height of the object is set to 4'-0" the label is showing up as 1.2192 and I'd like it to show up as 48.

The Working Units of the project are set to feet & fractional inches and everything else I have shows up as feet and fractional inches. I know there are other labels out there that do similar things and return the measurement in the correct format so I am assuming there is a way to tell the label to convert the units, I just can't find any documentation to that effect. And I haven't been able to find this looking through the other labels.
kevin s burns, AIA

massachusetts, usa



AC25 (1413), since AC6

Windows 10

Intel Core i7 -8700 @ 3.2 GHz~ 16 GB ram
2 REPLIES 2
Erich
Contributor
GDL works in meters internally so if you want some other output, you must do some conversion. Perhaps, these work for you:
nr = 0.345678 

h = 23 !! to move location in example only
TEXT2 0, h, STR ("%m", nr)          ! 0.346
TEXT2 0, h-1, STR ("%#10.2m", nr)   ! 35
TEXT2 0, h-2, STR ("%.4cm", nr)     ! 34.5678
TEXT2 0, h-3, STR ("%12.4cm", nr)   ! 34.5678
TEXT2 0, h-4, STR ("%.6mm", nr)     ! 345.678000
TEXT2 0, h-5, STR ("%+15e", nr)     ! +3.456780e-01  - nan??
TEXT2 0, h-6, STR ("%ffi", nr)      ! 1'-2"
TEXT2 0, h-7, STR ("%0.16ffi", nr)  ! 1'-1 5/8"
TEXT2 0, h-8, STR ("% .3fdi", nr)   ! 1'-1.609"
TEXT2 0, h-9, STR ("% -10.4df", nr) ! 1.1341'
TEXT2 0, h-10, STR ("%0.64fi", nr)  ! 13 39/64"
TEXT2 0, h-11, STR ("%+12.4di", nr) ! +13.6094"
TEXT2 0, h-12, STR ("%#.3sqm", nr)  ! 346
TEXT2 0, h-13, STR ("%+sqcm", nr)	 ! +3,456.78 
TEXT2 0, h-14, STR ("% .2sqmm", nr) ! 345,678.00 
TEXT2 0, h-15, STR ("%-12sqf", nr)  ! 3.72 
TEXT2 0, h-16, STR ("%10sqi", nr)   ! 535.80

alpha = 88.657 
TEXT2 0, h-17, STR ("%+10.3dd", alpha) ! +88.657°
TEXT2 0, h-18, STR ("%.1dms", alpha)   ! 88°39'
TEXT2 0, h-19, STR ("%.2dms", alpha)   ! 88°39'25"
TEXT2 0, h-20, STR ("%10.4gr", alpha)  ! 98.5078G
TEXT2 0, h-21, STR ("%rad", alpha)     ! 1.55R
TEXT2 0, h-22, STR ("%.2surv", alpha)  ! N 1°20'35" E
Erich

AC 19 6006 & AC 20
Mac OS 10.11.5
15" Retina MacBook Pro 2.6
27" iMac Retina 5K
David Maudlin
Virtuoso
kevin:

Also check out the Request functions, from page 293 of the AC 16 GDL Reference Guide:
With these requests, you can learn the dimension formats set in the Options/Preferences/Dimensions and Calculation Units dialog boxes. These requests return a format string that can be used as the first parameter in the STR () function.

David
David Maudlin / Architect
www.davidmaudlin.com
Digital Architecture
AC27 USA • iMac 27" 4.0GHz Quad-core i7 OSX11 | 24 gb ram • MacBook Pro M3 Pro | 36 gb ram OSX14