Community
Fusion API and Scripts
Got a new add-in to share? Need something specialized to be scripted? Ask questions or share what you’ve discovered with the community.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

populating drop down boxes with default values

1 REPLY 1
SOLVED
Reply
Message 1 of 2
brad.bylls
162 Views, 1 Reply

populating drop down boxes with default values

I am working on an api UI that has six drop down boxes.

What I am trying to do is when the user selects an item from the first drop down box, (which gathers data from a csv file) the other dropdown boxes are populated with a default value, but are still able select a different value from the dropdown list.

I have been working a couple of days on this and just can't figure it out. I'm sure it is pretty simple, but . . .

The complete code is attached.

Any help appreciated.

Thank you.

ps. I know the code is a little sloppy, but I want to get it to work first.

Brad Bylls
Tags (1)
1 REPLY 1
Message 2 of 2
OceanHydroAU
in reply to: brad.bylls

This fragment of code from one of my projects might help?

 

if cmdh[v]['type']=='RadioButtonGroupCommandInput' or cmdh[v]['type']=='ButtonRowCommandInput' or cmdh[v]['type']=='DropDownCommandInput': # button / Dropdown
    if cmdh[v]['type']=='DropDownCommandInput' and dlg[v].selectedItem is None:
        dlg[v].listItems.add(" ",True)  # Need to first create the selected object before we can select a different one
    if dlg[v].selectedItem.index >= 0:
        dlg[v].listItems[ dlg[v].selectedItem.index ].isSelected=False # Un select previous
    dlg[v].listItems[setting].isSelected=True # Select preset

 

That demo's adding/populating, as well as selecting stuff

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report