Requesting Parameters from another Object

Home Forums Problems and solutions in GDL Object design Requesting Parameters from another Object

Viewing 2 reply threads
  • Author
    Posts
    • #1813
      Kyle Boyd
      Participant

      I am wondering if it is possible in 19 to request/reference parameters from other objects. (I am building some custom labels).

      Currently I can grab an object’s ID using GLOB_ID, or similar. But I would like to grab a specific parameter in the object say, randomPAR. Is this possible? If so, how?

      So far I have tried:
      I have a custom object with the parameter TestPAR defined in the Parameters as a text parameter. In my label object, I try

      re_parameter = REQUEST (“ASSOCLP_PARVALUE”, “TestPAR”, nameind_TEST, type_TEST, flag_TEST, dim1_TEST, dim2_TEST, val_TEST)

      labelText = val_TEST

      but it results in the error “Uninitialized variable
      at line 13 in the 2D script of file TEST LABEL.gsm.”

      I have also tried substituting “ac_bottomlevel” for “TestPAR” with similar results. Can someone help?

      *this is a duplicate to a post I made on Archicad-Talk, but I figured would post here as well.
      That post is here
      Also I have referenced this post from 2003 https://archicad-talk.graphisoft.com/viewtopic.php?t=648

    • #1814
      James Murray
      Participant

      Initialize that val_TEST variable.

      val_TEST =""
      re_parameter = REQUEST (“ASSOCLP_PARVALUE”, “TestPAR”, nameind_TEST, type_TEST, flag_TEST, dim1_TEST, dim2_TEST, val_TEST)
      
      labelText = val_TEST

      If you don’t initialize you will always get a warning. Sometimes it doesn’t matter, but with Requests it often does. If variables aren’t initialized, they are assumed to be numbers, and that variable needs to be a string.

      James M

    • #1815
      Kyle Boyd
      Participant

      Awesome, thanks James!

      Now I know.

Viewing 2 reply threads
  • The forum ‘Object design’ is closed to new topics and replies.