Hi Andreas,
In some topic you send this script.
Very good work.
I try to get all 3D line of spaces.
Daniel OLIVES
Lyon-FRANCE
# Create room and space filter
filtre_P = RoomFilter()
filtre_E = SpaceFilter()
# toutes les pièces du modèle
#C_Pièces = FilteredElementCollector(doc).OfClass(SpatialElement).WherePasses(filtre_P).ToElements()
C_Espaces = FilteredElementCollector(doc).OfClass(SpatialElement).WherePasses(filtre_E).ToElements()
# Boundary options for rooms
opt = SpatialElementBoundaryOptions()
curves_E = []
dsLoop = []
dsPiece = []
for p in C_Espaces:
if p.Area > 0: # Make sure it has positive Area, i.e is placed
rvBoundary = p.GetBoundarySegments(opt) # Get room boundary
dsBoundary = [] # A Dynamo list to hold the boundary per room, remember it can be complex, with holes
for rvLoop in rvBoundary: # For each loop in the room boundary
dsLoop = [] # A list to hold each room's loop
for rvPiece in rvLoop: # Retrieve each segment of the loop
dsPiece = Revit.GeometryConversion.RevitToProtoCurve.ToProtoType(rvPiece.GetCurve(),True) # Read the segment as Curve and convert to Dynamo geometry
dsLoop.append(dsPiece) # Add the piece to the Dynamo Loop
dsBoundary.append(dsLoop) # Add the Dynamo Loop to the Dynamo Boundary
curves_E.append(dsBoundary) # Add the Dynamo Boundary per room to the Curves list
#- - - - - - - - - - - - - - - - - - - - - - - - - - -
##TransactionManager.Instance.TransactionTaskDone()
#- - - - - - - - - - - - - - - - - - - - - - - - - - -
OUT = C_Espaces, curves_E