Faces/Edges returned from Element.Geometry have no reference

By Mikako Harada

Issue

I'm trying to align two elements. NewAlignment() method requires references as arguments. But faces/edges returned from Element.Geometry has no reference. It simply returns null. How can I obtain references from a given element?

Solution

If you need to access valid reference objects from the give geometry, you will need to set CalculateReferences property of geometry option to true before you call Geometry. By default, it is set to false for performance reason: e.g.,

Options geomOp = m_app.Create.NewGeometryOptions();
    geomOp.ComputeReferences = true;

Comments

Leave a Reply

Discover more from Autodesk Developer Blog

Subscribe now to keep reading and get access to the full archive.

Continue reading