Get profiles from all rooms

I am attempting to get the profile of all the rooms. The problem is that I am only getting the room profile for the last room. Does anyone know how I would get the profile for all the rooms? In this instance, I just have two rooms, and I am only getting the profile from the last room ( Room 2 ).

Here is my code:

from rpw import db

options = SpatialElementBoundaryOptions()
options.SpatialElementBoundaryLocation = SpatialElementBoundaryLocation.Finish

rooms = db.Collector(of_category=‘OST_Rooms’)

for r in rooms:
segments = r.GetBoundarySegments(options)
for segmentList in segments:
profile = CurveLoop()
for boundarySegment in segmentList:
points = boundarySegment.GetCurve().Tessellate()
ip = 0
l = Line.CreateBound( points[ ip ], points[ ip + 1 ] )
profile.Append(l)

Make a new variable before the for loop. Something like loops = []. Then append each profile to that to have a list of all the curveloops

2 Likes

That did the trick, thanks.