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

GDL, Zone Label

Anonymous
Not applicable
Am I missing something or do I have something wrong with my eyes, but why the first line is okay but the second is not:
text2 0, 0, ROOM_NUMBER + ", " + ROOM_NAME
text2 0, 1, ROOM_AREA + " m2"
Code is part of zone label 2D script.
The 1st line shows up in project plan "01, Living Room", for example, while the 2nd line creates an error in GDL editing window when I check the code. If I cut the line with '!' after 'ROOM_AREA', then it'll be fine.

Thanks!
4 REPLIES 4
Jochen Suehlo
Moderator
You cannot combine a number with a string.
If ROOM_AREA is a number, you must convert it into a String,
e.g. by STR(ROOM_AREA,3,2) or similar.
Jochen Suehlo . AC12-27 . MAC OSX 14.4 . WIN11
GDL object creation: b-prisma.de
Anonymous
Not applicable
Joachim wrote:
You cannot combine a number with a string.
But isn't that the case at first line, too? I combined there:
the ROOM_NUMBER (I think its type is numerical, or...?)
+
comma inside quotation marks (that's string)
+
ROOM_NAME (its type is string, I guess)

So if the ROOM_NUMBER is string, then it's my mistake.
Erich
Booster
Despite the variable name, ROOM_NUMBER is a string. ROOM_AREA is a calculated number that you need to convert to a string.
Erich

AC 19 6006 & AC 20
Mac OS 10.11.5
15" Retina MacBook Pro 2.6
27" iMac Retina 5K
Anonymous
Not applicable
All right, that's clear! Thank you both for quick response!