2021-11-21 07:51 PM - last edited on 2021-11-24 03:46 PM by Laszlo Nagy
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
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
Solved! Go to Solution.
2021-11-22 06:15 PM
@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"
2021-11-22 07:55 PM
thanks everyone for the input and solutions. it works now !!! wayayayayay