How can I take element id from family groups


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).

try this (nested families must be shared)

# coding: utf-8 
import clr
from Autodesk.DesignScript.Geometry import *

import Autodesk
from Autodesk.Revit.DB import *

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):
	elif isinstance(x, FamilyInstance):
	else: pass	

OUT = inputElement, lstsubElemId
1 Like