GDL
About building parametric objects with GDL.
SOLVED!

gdl unit of text

lmcardoso
Booster

Hi,

 

I am a newbie in coding. sometimes i try to cook something but i end up spoiling the broth. i spent the last 30min reading the gdl editor on strings and integers but that thing is way to complex for me.

 

I am trying to change the units of the value of AxB but i cant seem to find it.

this is my object and now the area, which is no more than AxB is in millimiter but i want it in meters

lmcardoso_0-1637520533026.png

this is my code

 

set line_type ln01
pen pen01
fill fill01
poly2_b{5} 5, 3, 0, pen01, pen02, pen03,
0, 0, 1, 0, 0, 1, 0,
0, 0, 1,
A, 0, 1,
A, B, 1,
0, B, 1,
0, 0, 1


define style{2} "AC_STYLE_1" "Arial", txsz , 0

paragraph "AC_PRG_7" 2, 0, 0, 0, 1
pen 1
set style "AC_STYLE_1"
""+"< "+STR(1000*A,1,0)+" >"
endparagraph
textblock "AC_TEXTBLOCK_7" 0, 5, 0, 1, 1, 1,
"AC_PRG_7"
richtext2 A/2, .2, "AC_TEXTBLOCK_7"




paragraph "AC_PRG_8" 2, 0, 0, 0, 1

""+"< "+STR(1000*B,1,0)+" >"
endparagraph
textblock "AC_TEXTBLOCK_8" 0, 5, 90, 1, 1, 1,
"AC_PRG_8"
richtext2 0.2, B/2, "AC_TEXTBLOCK_8"

IF txt01=1 THEN
DEFINE STYLE TEXT_1 Arial, txsz , 5 , 0
SET STYLE TEXT_1
TEXT2 A/2, B/2, ""+STR(1*A*B,1,0)+"m2"
ENDIF

 

Can anyone help me please?

 

p,s, yeah i guess my code is super complicated ahaha

 

ArchiCAD 23/24/25 with Win 10
11 REPLIES 11
Solution
DGSketcher
Legend

@lmcardoso metric GDL coding is in meters by default, so you text should be...

TEXT2 A/2, B/2, "" + STR((A * B), 8, 3) + "m2"

Apple iMac Intel i9 / macOS Sonoma / AC27UKI (most recent builds.. if they work)
lmcardoso
Booster

thanks everyone for the input and solutions. it works now !!! wayayayayay

ArchiCAD 23/24/25 with Win 10