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 6 years, 3 months ago by
shaun coomber.
-
AuthorPosts
-
-
March 1, 2018 at 01:47 #3851
Melissa Fleming
ParticipantHi there!
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:
requestedValue=””
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, requestedValueThat 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
pen LABEL_TEXT_PEN
style “mySampleStyle”
“AREA OF WALL = “+””+requestedValue
endparagraphAs 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 #3854
Gergely Fehér
KeymasterIt 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.
Gergely Fehér
Team Leader, Library Team
GRAPHISOFT SE -
March 5, 2018 at 00:46 #3855
Melissa Fleming
ParticipantThanks Gergely,
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 #3856
Gergely Fehér
KeymasterHere you can find some examples about STR: https://gdl.graphisoft.com/gdl-basics/advanced-text-handling
Gergely Fehér
Team Leader, Library Team
GRAPHISOFT SE -
March 7, 2018 at 04:29 #3861
Melissa Fleming
ParticipantI 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 #4074
shaun coomber
ParticipantI expect AC22’s calculated element properties will do this, with the standard labels.
-
-
AuthorPosts
- The forum ‘Informations from the environment’ is closed to new topics and replies.