Room adjacency + CalculateSpatialElementGeometry
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi all,
I'm using the class CalculateSpatialElementGeometry to determine room/space adjacency in a Revit MEP project.
I want to know each boundary of a given room/space (wall, ceiling, floor).
My code is almost the same as the one used in this Wiki
Here is a part of my source code :
SpatialElementBoundaryOptions Opt = new SpatialElementBoundaryOptions();
Opt.StoreFreeBoundaryFaces = false;
Opt.SpatialElementBoundaryLocation = SpatialElementBoundaryLocation.Finish;
Calc = new SpatialElementGeometryCalculator(doc, Opt);
SpatialElementGeometryResults G = Calc.CalculateSpatialElementGeometry(space);
Solid S = G.GetGeometry();
space is of class Space, but the problem is the same with a Room.
Problem : inside certain projects, it appears that the result of that code is not consistent through consecutive calls.
First call :
S.SurfaceArea = 162
S.Volume = 120
Second and subsequent calls :
S.SurfaceArea = 200
S.Volume = 250
Inconsistency can also be seen inside GetBoundaryFaceInfo, because SpatialElementBoundarySubface.SpatialBoundaryElement changes between calls 1 and 2+.
Of course, there is no modification to project database between calls.
Is it a known limitation of Revit API, or do I make something wrong ?
Many thanks in advance 😉