Getting coordinates for faces of MEP spaces

Getting coordinates for faces of MEP spaces

ottosson_mathias
Advocate Advocate
649 Views
2 Replies
Message 1 of 3

Getting coordinates for faces of MEP spaces

ottosson_mathias
Advocate
Advocate

I want to visualize different faces of MEP spaces in 3d using Direct3DContext (in a later step).

 

I've collected all MEP spaces from my model, and then use Element.get_Geometry to get the geometric representation:

 

 

var geometry = space.get_Geometry(new Options
{
    IncludeNonVisibleObjects = true,
});

 

 

But after this I'm not sure what to do to get the coordinates to be able to draw individual faces of the space

 

space_faces.png

 

In the PlanarFace objects I can not find enough information to draw it... Maybe I misunderstand something, but from what I can see I need a Length property to be able to draw using this information. Origin, Directions (XVector, YVector) is not enough, right?

 

 

0 Likes
Accepted solutions (1)
650 Views
2 Replies
Replies (2)
Message 2 of 3

jeremytammik
Autodesk
Autodesk
Accepted solution

You can use the geometry information that you point out. It contains all the information you need.

 

There is an easier way, though: you can query the Space element for its ClosedShell property:

 

https://www.revitapidocs.com/2020/e7dbd26c-ef27-f95c-8b14-87764e86b35a.htm

 

That provides nicer results than the Face objects in the geometry; the former is a closed shell, the individual faces may have gaps between them.

 

Here are samples visualising rooms using AVF, DirectShape elements and glTF to display the ClosedShell data:

 

   



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

0 Likes
Message 3 of 3

ottosson_mathias
Advocate
Advocate

Thanks a lot!

0 Likes