Label that displays another object's parameter

Home Forums Problems and solutions in GDL Informations from the environment Label that displays another object's parameter

Viewing 5 reply threads
  • Author
    Posts
    • #3851
      Melissa Fleming
      Participant

      Hi 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, 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
      pen LABEL_TEXT_PEN
      style “mySampleStyle”
      “AREA OF WALL = “+””+requestedValue
      endparagraph

      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.

    • #3854
      Gergely Fehér
      Keymaster

      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.

      Gergely Fehér
      Team Leader, Library Team
      GRAPHISOFT SE

    • #3855
      Melissa Fleming
      Participant

      Thanks 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!

    • #3856
      Gergely Fehér
      Keymaster

      Here 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

    • #3861
      Melissa Fleming
      Participant

      I understand your suggestion Gergely, but I just can’t figure it out.
      I think this one is over my head! Thanks though

    • #4074
      shaun coomber
      Participant

      I expect AC22’s calculated element properties will do this, with the standard labels.

Viewing 5 reply threads
  • The forum ‘Informations from the environment’ is closed to new topics and replies.