Get Parameter Value from combining lists

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

Thank you all

Thank you for starting a new post.

If I understand you correctly I think this is what you are looking for.

2 Likes

:star_struck: the simplicity of your method is amazing. It reduces my script to less than half.
Thank you

1 Like

Hi there,

I work on the same issue, rather than start modifying third-party families, I look for áll the values at once.

I am a bit surprised it works so well.

Has anyone an idea how to prioritize when multiple Parameters would contain a value?

Kind regards,

Willem

If I understand your question correctly this should get you what you need. Item number two is the one to watch in each of the output lists.

Most Common methods will return the first value if they are all different.

Most Common Python

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
1 Like

Thank you Steve.

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.