Finding duplicated types

Hi everybody,
I’m tyring to create a script to find if two types of a family are the same.
We can have two types with different names but all their type parameters are actually the same. So, I call that “duplicated types” even though their names are different.

My approach:
I would like to export all the type parameters (or most of them) and their values in a every type of a family. After that I would like to use excel to find duplicate values.

Is there a way to take all type parameters of a type (even by parameter group)?

Maybe another approach?

Thank you in advance.

I guess this will get you started

Together with this

If you have the Family Type, you can just use Element.Parameters to get all the type parameters and values. You may have to convert those lists to strings but then you can sort and compare sublists for duplicates.

@Nick_Boyts
I believe that is not what @JC.Moreno is after.
As far i understand he got Family A with 5 Types.
He wanna find out if any of these 5 Types are completely the same (their parameter Values)
(cept for their Type Names).

That’s what I’m suggesting. You would get all the type parameters from each type (via Element.Parameters), convert to string, remove any parameters from the list that should not be compared, and then compare those sublists (parameters of each type) to each other for duplicates. The important part is that you’re comparing the sublist as a whole, not each item in the sublist individually.

Then i missunderstood you, but AFAIK you can’t just feed
the Family Type into the Element.Parameters node.
You only get what Parameters are in the Family and
not the Values per Type.

FamilyInstance and FamilyType are both Elements and have their own set of parameters.

2 Likes

Ah, i missed the difference in Family Types and Family.Types (the dot) :crazy_face:

I guess it is time for weekend .

Might need a sort, and then a Parameter.Value (parameter names are long, why waste time knowing the matching values?) String.FromArray, And finally == with cross product.

Note that with the inclusion of global parameters this gets harder as values associated to the global parameter could be equal but unintentionally so.

Yeah, I left some of that out in the example above but you would definitely need to sort and likely also remove certain parameters that you’re not concerned with.

Tank you all.
Another approach would be to export family types as a catalogue and using excel to find duplicated values.

Hi Jacob,
I’m trying to do as you suggested but I think I’m doing something wrong.

The problem is that my list of values has several levels. That is, I only want to compare the types within each family but the string from array nodes do not give me the ability to use levels.

Could you told me what I’m doing wrong please?

Ah! I forgot string from array does the wipe node and doesn’t have list levels or lacing.

Gonna have to go with a for loop in either[a custom node to force Lacing and list levels on the list], [a custom definition using imperative code in design script] or [Python] to simplify the values.

Give it a shot and let me know where you get. I’ll be on a 4 hour train ride back home tonight, and I’ll pick up whatever you post back then.