Calculate area of room boundary walls

Calculate area of room boundary walls

Anonymous
Not applicable
1,222 Views
3 Replies
Message 1 of 4

Calculate area of room boundary walls

Anonymous
Not applicable

Hi,

how calculate area of boundary room walls with opening?

Walls which have door or window is not valid calculate by SpatialElementGeometryCalculator. 

 foreach( SpatialElement e in roomCol )
      {
        Room room = e as Room;
 
        if( room != null )
        {
          try
          {
            Autodesk.Revit.DB
              .SpatialElementGeometryCalculator
                calc = new Autodesk.Revit.DB
                  .SpatialElementGeometryCalculator(
                    doc, sebOptions );
 
            SpatialElementGeometryResults results
              = calc.CalculateSpatialElementGeometry(
                room );
 
            Solid roomSolid = results.GetGeometry();
 
            foreach( Face face in roomSolid.Faces )
            {
              IList<SpatialElementBoundarySubface>
                subfaceList = results.GetBoundaryFaceInfo(
                  face );
 
              foreach( SpatialElementBoundarySubface
                subface in subfaceList )
              {
                if( subface.SubfaceType
                  == SubfaceType.Side )
                {
                  Element wall = doc.GetElement(
                    subface.SpatialBoundaryElement
                      .HostElementId );
 
                  double subfaceArea = subface
                    .GetSubface().Area;
...
0 Likes
1,223 Views
3 Replies
Replies (3)
Message 2 of 4

jeremytammik
Autodesk
Autodesk

Dear Anton,

 

Happy New Year to you!

 

Have you set the SpatialElementBoundaryLocation = SpatialElementBoundaryLocation.Center to close the geometry, as suggested by Arif?

 

 

http://thebuildingcoder.typepad.com/blog/2015/03/findinserts-retrieves-all-openings-in-all-wall-type...

 

Apparently, it does not work for Finish.

 

Cheers,

 

Jeremy



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

Message 3 of 4

Anonymous
Not applicable

Jeremy, thanks you and Happy New Year to you!
SpatialElementBoundaryLocation.Center and SpatialElementBoundaryLocation.Finish returns identical results in my case.

Window area is not excluded from wall in
subface.GetSubface().Area

0 Likes
Message 4 of 4

jeremytammik
Autodesk
Autodesk

Strange. I wonder how Arif can succeed in using it like that?



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

0 Likes