Room Boundary Segments Ignoring Room Transform Rotation

Room Boundary Segments Ignoring Room Transform Rotation

matthew_conwayN7C2G
Enthusiast Enthusiast
705 Views
3 Replies
Message 1 of 4

Room Boundary Segments Ignoring Room Transform Rotation

matthew_conwayN7C2G
Enthusiast
Enthusiast

matthew_conwayN7C2G_0-1635791629963.png

 

I have a room in Revit that is rotated (image above on the left), when I extract it's boundary curves using the code below, I get the image on the right (I copied the XYZ values from Visual Studio's debug into a Grasshopper panel to quickly verify the vertices). My question is, is this the expected behavior? Is there a way to get the transform of the Room Element to correctly orient the boundary segment vertices in Model Space?

 

 

        private List<XYZ> GetRoomVertices(Room room)
        {
            IList<IList<BoundarySegment>> loops = room.GetBoundarySegments(new SpatialElementBoundaryOptions());

            //convert boundary segments to curve loops
            List<XYZ> verts = new List<XYZ>();
            foreach (List<BoundarySegment> loop in loops)
            {
                foreach (BoundarySegment segment in loop)
                {
                    verts.Add(segment.GetCurve().GetEndPoint(0));
                }
            }

            return verts;
        }

 

 

 

Accepted solutions (1)
706 Views
3 Replies
Replies (3)
Message 2 of 4

matthew_conwayN7C2G
Enthusiast
Enthusiast

matthew_conwayN7C2G_0-1635796495626.png

It looks like both Room.CoreCenterBoundary and Room.FinishBoundary are giving the correct output in Dynamo, are either of these nodes doing something different then the method I outlined above? I've tried adding the Finish Face Options and that didn't change the output.

0 Likes
Message 3 of 4

RPTHOMAS108
Mentor
Mentor
Accepted solution

I don't seem to see the same behaviour. I created a room rotated at 45 degrees and one of the boundary segment line directions is as follows:

 

211101a.PNG

 

Is it the case that the view is rotated not the room? Most your rooms seem to be at that angle. For that arrangement I would have rotated project north since you benefit from having key direction of building aligned with the screen. Some don't follow that approach and like to control everything with scope box rotations. Either way the view may be set up to true north.

 

Yes Dynamo often does do far more for the user, Revit API is more first principles (a lot of the time e.g. units). However I don't think it is doing anything extra here.

0 Likes
Message 4 of 4

matthew_conwayN7C2G
Enthusiast
Enthusiast

The List<XYZ> was being edited in another method, I forgot that XYZ Elements are persistent between methods even if you aren't passing them out. I cloned my List<XYZ> and this solved the issue, thanks for looking into it @RPTHOMAS108 .

0 Likes