Home › Forums › Problems and solutions in GDL › Informations from the environment › Label that displays another object's parameter
Tagged: label, Request, ASSOCLP_PARVALUE
- This topic has 5 replies, 3 voices, and was last updated 5 years ago by shaun coomber.
March 1, 2018 at 01:47 #3851
I’m trying to create a label that will display the area of a wall and the length of a wall and also the calculated average wall height (area/length). This is to be use for labelling walls on boundaries. I’ve attached a screen grab of a text label indicating what I’m trying to achieve.
So far, I’ve placed the “wall tiles” object (attached) that I found in another forum topic (thanks) and have been trying to reference the parameter “calcA” in a label. I’ve used the request command in the master script like this:
n = REQUEST(“ASSOCLP_PARVALUE”, “calcA”, DUMMY_name_index, type, DUMMY_flags, DUMMY_dim1, DUMMY_dim2, requestedValue)
Then I have written the following text2 command in the 2D script:
text2 0,0, requestedValue
That all works fine – producing a simple label that displays the wall area alone. BUT when I try and set up a paragraph so that I can include formatting and the leader text of “AREA OF WALL = ” before the displayed requestedValue, the best that I get is a label arrow with a dot on the end where the text should be. I haven’t even tried working on the length and average height calculations yet!! This is the script I’ve used for the paragraph, followed by textblock & richtext commands:
paragraph “label_para” LABEL_TEXT_ALIGN, ! name alignment
0, ! firstline_indent
0, ! left_indent
0, ! right_indent
LABEL_TEXT_LEADING ! line_spacing
“AREA OF WALL = “+””+requestedValue
As you can probably tell, I’ve not used the request command before and am still learning paragraphs. Any help you can offer would be greatly appreciated.
March 2, 2018 at 16:38 #3854Gergely FehérKeymaster
It seems your calculated area is a number, which you can’t add to a string. You can create a string from a number with the STR function.
Team Leader, Library Team
March 5, 2018 at 00:46 #3855
Can you provide me with a direction or a web link on how to set up the string function and where to put it in the script? I get a bit lost with strings!
March 5, 2018 at 08:28 #3856Gergely FehérKeymaster
Here you can find some examples about STR: https://gdl.graphisoft.com/gdl-basics/advanced-text-handling
Team Leader, Library Team
March 7, 2018 at 04:29 #3861
I understand your suggestion Gergely, but I just can’t figure it out.
I think this one is over my head! Thanks though
May 10, 2018 at 17:00 #4074shaun coomberParticipant
I expect AC22’s calculated element properties will do this, with the standard labels.
- The forum ‘Informations from the environment’ is closed to new topics and replies.