If you're new to working with Autodesk® Revit® files, looking at a file's geometry can be a good place to start. The file is actually a set of elements that correspond to BIM components such as walls or dimensions.
Each element has three parts:
- ElementHeader – element’s basic data
- Element – element-specific properties
- GElement – geometry
In this article we are going to talk about the third part, GElement – an element’s geometry. A GElement contains a set of geometry nodes combined into groups, which represent the geometry used for different types of views. Most low-level geometry is stored as proprietary Boundary Representation (B-Rep) data.
The relationship between an element and its B-Rep geometry is often quite complex. One way to simplify the investigation of this data is to export the geometry to a well-documented open format such as COLLADA. Teigha’s COLLADA export module collects simplified geometry for 3D objects, lights and materials and exports it to a COLLADA .dae file. The resulting .dae file may be opened and rendered by a number of third-party viewers or by the OdaBimApp sample application included in Teigha BIM. You can export the geometry from an entire file using the active view, or export a single BIM element to facilitate the investigation of a particular object.
The COLLADA export module may also be used as a basis for designing a custom export to convert Autodesk Revit file geometry to a custom representation. A custom export module must implement the following interfaces:
The following is a list of key methods implemented in OdColladaOut, Teigha BIM’s COLLADA export sample application:
- OdGiBaseVectorizer::doDraw – called for every element and for all objects inside an element.
- OdGiBaseVectorizer::rasterImageDc/image/shape/text/mesh/shell – perform processing for specific entity types.
- OdGiGeometrySimplifier::shellProc – adds all vertices of the shell to a container.
- OdGiGeometrySimplifier::triangleOut – collects information about triangles on a shell and computes normals for vertices.
- OdGsBaseMaterialVectorizer::fillMaterialCache – gets material parameters.
- OdGiGeometrySimplifier::meshFaceOut, shellFaceOut – collects mappings of materials to triangles.
Implementing these methods in your custom classes gives you the opportunity to perform any necessary conversion to your custom data representation and provides a deeper understanding of the Autodesk Revit file content.
Subscribers can find more information about Teigha BIM in the online help.
Autodesk and Revit are registered trademarks or trademarks of Autodesk, Inc., in the USA and other countries.