Compare parameter value to an Array in GDL

Home Forums Problems and solutions in GDL Informations from the environment Compare parameter value to an Array in GDL

Viewing 2 reply threads
  • Author
    Posts
    • #18276
      David Cook
      Participant

      Hi Everyone.

      I’m looking to create a hybrid between two label types we have in our office to see if we can create something that has the best of two worlds.

      LABEL 1: Reads our surface names (set up with a CODE:DESCRIPTION format) and strips off the colon and descriptions to display the code. Works well, provided instant update if the material is update in the surfaces dialogue or if the boss takes the file to site to meet the client and changes paint colours around the place.

      LABEL 2: We have a finishes object on a negative story that has data which generates our finishes schedule. This data is then published the codes then become available for it’s partner label to read from. Great for QA in some ways in that you can’t annotate something that doesn’t have a place holder in the finishes schedule. But not so great if someone goes and changes the model surface/composite etc as it’s not linked

      Label 2 puts the codes it imports into a parameter array. Label 1 also brings the remaining string into a parameter.

      What I want to do is combine the code and make a line of GDL to return a true /false result of a search of the Label 2 array to find if the value provided from Label 1’s request is present.

      The idea is to get the best of both. Have a label that returns the code from the model appearance, but if it’s not in the schedule data, display something outrageous that prompts the user to go and put it in there so the correct code is displayed.

      Does anyone know if this is possible? Any direction on what to investigate with regards to the comparison would be most helpful.

      Thanks!

    • #18277
      Péter Baksa
      Keymaster

      Write a WHILE loop that compares the value to each value in the array, and terminates when found.
      If you need to use it in many places with many arrays, write it as a macro.

      Péter Baksa
      Library Platform, Software Engineer
      GRAPHISOFT SE

    • #18278
      David Cook
      Participant

      Hi Peter

      Thanks for that. I’ll give it a shot!
      David

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