Python get Name of the Family from Elements

Hi all,
I am trying to execute some code withe the python script node, I am a HUGE newbie at the moment, but I’m working on it :wink:

At the moment I am stuck at finding the name of the family from a list of elements.
If you can help me with that, it would be much appreciated.

This is the code so far:

#Collecting instances from the model with the Communication Device category
allCommDev = []
cl = FilteredElementCollector(doc).OfCategory(BuiltInCategory.OST_CommunicationDevices).WhereElementIsNotElementType()
allCommDev = cl.ToElements()

Obviously I’ve tried a lot of different pieces of codes (that I am not writing because are almost blasphemy), but ended nowhere :confused:

thanks in advance

You need to loop through your list :slight_smile:

1 Like

thanks @CVestesen,
I know it would require a loop iteration but I don’t know the syntax to do that, if you have a reference documentation it would be helpful too :slight_smile:

And if you want the family name, you need to change the CollectorFilter to WhereElementIsElementType() and then get the property from ElementType “FamilyName”. On the above code I used the property from the Element class to collect the Element.Name :slight_smile:

1 Like

thanks @CVestesen :slight_smile:

1 Like