I’d like to get the width of all doors on my project to determine whether or not they have the minimum requirements. However some doors have their width value stored on the Width parameter, while others on Rough Width.
I was wondering how could I get on a single list the values of both parameters (If possible)
or if I can get the parameter that contains Width on the string. I am kind of lost on this.
I could get the job done by doing two separate get.ParameterValueByName but I was trying an alternative approach
values = IN[0]
def mostCommon(value):
dict = {}
for i in value:
common = dict.get(i)
if common == None:
dict[i] = 1
else:
dict[i] = dict[i] + 1
count = 0
common = None
for key in dict:
value = dict[key]
if value > count:
count = value
common = key
return common
listOut = []
for value in values:
listOut.append(mostCommon(value))
OUT = listOut
Even though you have what you wanted rn, I would advise you clean those families in your project from crap. Minimum door requirements apply to doors, not wall openings (Rough Width = Width + 10 mm or more, max 30 mm)
Get all doors that have only rough Width populated, and set formula to populate Width. Vice versa, get all doors that have populated Width, and set formula to populate Rough Width.
Not to mention that door families should be checked. Voids or wall openings should be driven by Rough Width, and frames with Width, but at least (and for now) you could set the values properly.