AMEE_in_Revit.Addin.Visualizations.CO2eVisualisationCreator.GetFaces C# (CSharp) Метод

GetFaces() приватный статический Метод

private static GetFaces ( Element element ) : FaceArray
element Element
Результат FaceArray
        private static FaceArray GetFaces(Element element)
        {
            var faceArray = new FaceArray();
            var options = new Options();
            options.ComputeReferences = true;
            var geomElem = element.get_Geometry(options);
            if (geomElem != null)
            {
                foreach (GeometryObject geomObj in geomElem.Objects)
                {
                    var solid = geomObj as Solid;
                    if (solid != null)
                    {
                        foreach (Face f in solid.Faces)
                        {
                            faceArray.Append(f);
                        }
                    }
                    var inst = geomObj as GeometryInstance;
                    if (inst != null) // in-place family walls
                    {
                        foreach (Object o in inst.SymbolGeometry.Objects)
                        {
                            var s = o as Solid;
                            if (s != null)
                            {
                                foreach (Face f in s.Faces)
                                {
                                    faceArray.Append(f);
                                }
                            }
                        }
                    }
                }
            }
            return faceArray;
        }