Message 1 of 3
Reference of Face is null with Revit 2018
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I try to get all faces of element, it works well with Revit 2106, but some faces have no reference with Revit 2018.
The code is something like below:
Options geOpt = new Options(); geOpt.ComputeReferences = true; // ensure we calculate the reference so that we can reserve the persistent representation string Dictionary<Face, Solid> faceAndSolidDict1 = new Dictionary<Face, Solid>(); List<Solid> solids1 = GetElementSolids(elem1, geOpt); //a method to get element's solids
// add all faces into a list foreach (Solid solid in solids1) { foreach (Face face in solid.Faces) { faceAndSolidDict1.Add(face, solid); if (null != element1Faces) { element1Faces.Add(face); } } }
I find that Face.reference is null when Face.OrientationMatchesSurfaceOrientation is false.
Thanks