
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi everyone,
I'm working on a geometry exporter. I want to make exports as light as possible so I'm using the couple SymbolGeometry => Transforms a lot. I thought this will work for almost every geometry, but I find out that many geometries are not considered as instance of a Symbol.
As an example, you can take Dining Chair (3).rfa which is part of the built-in samples of (at least) Revit 2016. The file is attached. As you can see the chair is composed of 6 parts:
- The back.
- The bed.
- The 4 legs. This is the same geometry: same number of vertices and faces.
When I export instances of this chair, my algorithm considers the legs as 4 different geometries.
Is Revit not storing a couple geometry => transforms? It looks like it has integrated the matrix inside the geometry and it is bound together forever :'(
Is there any way to get a "main geometry" and matrices?
Thanks !
Ps : the recursive algorithm I'm using :
public void FindFinalReference (GeometryInstance instance, double exportRatio, Transform transform) { if (instance.SymbolGeometry != null) { foreach (GeometryObject go in instance.SymbolGeometry) { if (go is Solid solid) { AddSolid(solid, exportRatio, transform); } else if (go is Mesh mesh) { AddMesh(ref mesh, transform); } else if (go is GeometryInstance instanceNext) { Transform mergeTr = transform.Multiply(instanceNext.Transform); FindFinalReference(instanceNext, exportRatio, mergeTr); } } } }
Solved! Go to Solution.