I don’t quite understand what you are asking? Do you want to get all the FamilyInstances of the Types [Blue, Red, Yellow]? or do you want to get the Families, so not the Instances?
yes, i have symbols they have to be placed on doors.
the doors are in the view, but my symbols remain in the project-browser!
How can i “take” them via dynamo python
a option would place the instances type by type so i can collect them, but i would prefer the workflow to get the type and later i place them on the doors, the placement depents on different values ("Gelb", "Rot"...)
You should use:
WhereElementIsElementType()
instead of
WhereElementIsNotElementType()
Because you are search for FamilySymbols (better known as Family Types)
Another problem is that you will find System Families, I filter these away using a Try Except because they will throw an error if you query their “Family” property.
I dont understand why you want to do this in Python, because it is done with a few nodes in Dynamo, but this would do the trick.
Types = ["Blau","Gelb","Rot"]
doc = DocumentManager.Instance.CurrentDBDocument
TransactionManager.Instance.EnsureInTransaction(doc)
myDoors = FilteredElementCollector(doc).
OfCategory(BuiltInCategory.OST_Doors).WhereElementIsNotElementType().ToElements()
Symbl = FilteredElementCollector(doc).
OfCategory(BuiltInCategory.OST_DetailComponents).WhereElementIsElementType().ToElements()
elements = UnwrapElement(myDoors)
points =[]
for e in elements:
bb = e.get_BoundingBox(None)
if not bb is None:
centre = bb.Min+(bb.Max-bb.Min)/2
points.append(centre.ToPoint())
for s in Symbl:
try:
if Types.Contains(s.Family.Name):
output.append(s)
except:
pass
TransactionManager.Instance.TransactionTaskDone()
OUT = points