GDL
About building parametric objects with GDL.
SOLVED!

Drop down list not working correctly

Anonymous
Not applicable
Hi,
I started working on an object that provided the correct joist connector based on member size, S4S vs. RS, Single joist, double Joist, etc.... I planed on expanding this to other connectors once I complete this phase of the object. This is why I do not have many items in the dropdown lists yet. (see attached)

The first part of this is creating the object so there is a lot of space for expansion so I came up with 7 categories and assigned a number to each category. Category 1 would have a number X000000. The second Category would have a number X00000, third category would be X0000, all the way to category 7 which would be X. The first item in the drop down list in each category I would assign a 1 where the X is and if there is a second option in that category, I would put a 2 for the second item and so on. Basically what I am doing is creating my own custom file number based on the choices I make in each category. This number then refers to the callout which is the last drop down which displays the joist hangers available based on what made for selections in each category.

All of the drop down list comes from the value command.
For example:
if Cat_3 = '2x' then values `Cat_5` '2x6','2x8','2x10','2x12','2x14'

The issue I am having when you answer the questions (again not all categories has multiple items as I am just starting this) the end result will create this unique number which will provide a drop down list of the connectors. You will notice the callout description should automatically updated based on the selections in each category but it is not always displaying the correct connectors. If I click on the connector line and click the triangle I can see the correct options but sometime if I click off from it this it goes back to a different callout.

One quick way to see an issue is change the Cat_7 from single to double, to triple and you will see the Callout is not correct. It is like it reports on the previous selection not the current selection.

I have never had this happen before. If the items in a drop down list changes based on a different items selected in the drop down it will automatically change the list, even the first item will automatically change to the first item in the drop down list. It is almost like I need to loop this back or clear out the last selection or something.

I know this a really long explication but I hope I have captured someone's attention with this and can help me with what I need to adjust to get this working.

I have attached the object in hopes someone will understand what I am doing and help me out.

Thank you for taking the time in helping me out.

John Campbell
1 ACCEPTED SOLUTION

Accepted Solutions
Solution
Peter Baksa
Graphisoft
Graphisoft
Replace the line
parameters File_number = fn_1+fn_2+fn_3+fn_4+fn_5+fn_6+fn_7
to
File_number = fn_1+fn_2+fn_3+fn_4+fn_5+fn_6+fn_7
parameters File_number = File_number
Your code will work with this modification, but for further development I recommend replacing all PARAMETERS commands in a similar way.
Péter Baksa
Software Engineer, Library as a Platform
Graphisoft SE, Budapest

View solution in original post

4 REPLIES 4
Peter Baksa
Graphisoft
Graphisoft
Hi camp20,

GDL reads an object's parameters at the start of the script, loading them into variables with the same name. Changing variables don't change the original parameters. That's why GDL has the PARAMETERS command to be able to change parameters, but it only changes the stored parameter value, it has no effect on the current value of the variable during script run.
The conditions executing the VALUES statements at the end of your script don't see the changed parameter value of File_number at the last run of the parameter script.

The following pattern needs to be used to make it work correctly:
parameter = value
parameters parameter = parameter
Péter Baksa
Software Engineer, Library as a Platform
Graphisoft SE, Budapest
Anonymous
Not applicable
Thank you very much Peter for looking at this for me. I am not understanding what I need to adjust to get this to work with the info you provided. Do you mind explaining a little more as I am trying to adjust the code and I am unable to get anything to work.

Thanks again for your help.

John
Solution
Peter Baksa
Graphisoft
Graphisoft
Replace the line
parameters File_number = fn_1+fn_2+fn_3+fn_4+fn_5+fn_6+fn_7
to
File_number = fn_1+fn_2+fn_3+fn_4+fn_5+fn_6+fn_7
parameters File_number = File_number
Your code will work with this modification, but for further development I recommend replacing all PARAMETERS commands in a similar way.
Péter Baksa
Software Engineer, Library as a Platform
Graphisoft SE, Budapest
Anonymous
Not applicable
Thank again Peter! It works great now.