Room.Boundary property was returning segments related to “Room Area Computation” setting (such as “At wall finish” and “At wall center”) in Revit 2012. However, Room.Boundary property is obsolete in Revit 2013 and Room.GetBoundarySegments() method is no longer related to “Room Are Computation” setting. Is there any way to get the room boundary relative to “Room Are Computation” setting in Revit 2013? The answer is Yes.
This is an regression issue. But Here is workaround.
// This is the workaround to get room boundary based on
// "Room Area Computation"setting
//
Autodesk.Revit.DB.VolumeCalculationSetting vsetting =
doc.Settings.VolumeCalculationSetting;
Autodesk.Revit.DB.SpatialElementBoundaryOptions options
= new Autodesk.Revit.DB.SpatialElementBoundaryOptions();
options.SpatialElementBoundaryLocation =
(Autodesk.Revit.DB.SpatialElementBoundaryLocation)vsetting.
VolumeCalculationOptions.RoomAreaBoundaryLocation;
// Getting curves of the room boundary
//
System.Collections.Generic.IList<Autodesk.Revit.DB.Curve> curveAry =
new System.Collections.Generic.List<Autodesk.Revit.DB.Curve>();
foreach (Collections.Generic.IList<Revit.DB.BoundarySegment>
bndSegAry in room.GetBoundarySegments(options))
{
foreach (Revit.DB.BoundarySegment bndSeg in bndSegAry)
curveAry.Add(bndSeg.Curve);
}

Leave a Reply