Change dropdown menu-content accordingly to input

Hi, I’ve been struggling for a while but unable to figure it out.
I want the user to select a material from the ‘MatInput’ -dropdown menu. The dropdown menu ‘AspectInput’ should update to a specific dictionary according to ‘MatInput’.

Right now I have to select concrete for example, run the main code. Then I have to open up ‘AspectInput’, press apply. Now the ‘AspectInput’ -dropdown menu is updated.

Basically what I want is to select something in ‘MatInput’, and the ‘AspectInput’ dropdown menu should be changed accordingly.

# main window
import os
import sys
import clr
import re

clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *

# The current uidoc, doc, uiapp, and app are stored in the following variables
doc = __currentdoc__
app = __app__
uidoc = __uidoc__
uiapp = __uiapp__

# The inputs are stored in the __inputs__ dictionary
# The key for each input can be set through the UI
inputs = __inputs__


mat_input = inputs["MatInput"]
print(mat_input)

aspect_input = inputs["AspectInput"]
print(aspect_input)
# MatInput (dropdown menu)
import clr
materials = {
    "concrete": "concrete",
    "plastic": "plastic",
    "insulation": "insulation"
}

__out__=materials
# AspectInput (dropwdown menu)
import clr

if mat_input == "concrete":
    dict = {
        "type1": "light",
        "type2": "medium",
        "type3": "heavy"
    }
    
elif mat_input == "plastic":
    dict = {
        "color1": "white",
        "color2": "yellow",
        "color3": "red"
    }
    
elif mat_input == "insulation":
    dict = {
        "type1": "foam",
        "type2": "hard wool",
        "type3": "soft wool"
    }

__out__=dict```
![Screenshot 2025-03-20 155418|252x500](upload://xMJVjUR2oyfjprhf06ELp79RQfn.png)
1 Like

Something went wrong with the screen shot. Here is the correct one:

hey @MilanSabel1 !
I see what you mean. You wish to have an input define the content of another input.
The best option here would be to use the sequences!
Here’s how you’d do that here:

hey there @MilanSabel1 !
Just checking in on this to make sure you were able to get what you needed :slight_smile: