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```
