How can I take element id from family groups

Hello

I want to take element id from family groups. I can see family group ıd but I want IDs of all objects in the family. there are too many parts in the family. it is difficult to select individual objects with tab command. how can I take list easily all objects id

Thank you

I am not sure what family groups are, but if you are referring to Model Groups or Detail Groups, you can use custom nodes that receive Group Instances and return Members (Group > Members).

Hello
try this (nested families must be shared)

# coding: utf-8 
import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *

clr.AddReference('RevitAPI')
import Autodesk
from Autodesk.Revit.DB import *

clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
doc = DocumentManager.Instance.CurrentDBDocument


toList = lambda x : x if hasattr(x, "__iter__") else [ x ]
inputElement = toList(UnwrapElement(IN[0]))
lstsubElemId = []
for x in inputElement:	
	if isinstance(x, Group):
		lstsubElemId.append(x.GetMemberIds())
	elif isinstance(x, FamilyInstance):
		lstsubElemId.append(x.GetSubComponentIds())
	else: pass	

OUT = inputElement, lstsubElemId
4 Likes

Thank you

1 Like