GetFaces() public static method

get all faces that compose the geometry solid of given element
public static GetFaces ( Autodesk.Revit.DB.Element elem ) : FaceArray
elem Autodesk.Revit.DB.Element element to be calculated
return FaceArray
Exemplo n.º 1
0
        /// <summary>
        /// get necessary data when create AreaReinforcement on a horizontal floor
        /// </summary>
        /// <param name="floor">floor on which to create AreaReinforcemen</param>
        /// <param name="refer">reference of the horizontal face on the floor</param>
        /// <param name="curves">curves compose the horizontal face of the floor</param>
        /// <returns>is successful</returns>
        public bool GetFloorGeom(Floor floor, ref Reference refer, ref IList <Curve> curves)
        {
            //get horizontal face's reference
            FaceArray faces = GeomUtil.GetFaces(floor);

            foreach (Face face in faces)
            {
                if (GeomUtil.IsHorizontalFace(face))
                {
                    refer = face.Reference;
                    break;
                }
            }
            if (null == refer)
            {
                return(false);
            }
            //get analytical model profile
            AnalyticalModel model = floor.GetAnalyticalModel();

            if (null == model)
            {
                return(false);
            }

            curves = model.GetCurves(AnalyticalCurveType.ActiveCurves);

            if (!GeomUtil.IsRectangular(curves))
            {
                return(false);
            }
            curves = AddInlaidCurves(curves, 0.5);

            return(true);
        }
Exemplo n.º 2
0
        /// <summary>
        /// get necessary data when create AreaReinforcement on a horizontal floor
        /// </summary>
        /// <param name="floor">floor on which to create AreaReinforcemen</param>
        /// <param name="refer">reference of the horizontal face on the floor</param>
        /// <param name="curves">curves compose the horizontal face of the floor</param>
        /// <returns>is successful</returns>
        public bool GetFloorGeom(Floor floor, ref Reference refer, ref IList <Curve> curves)
        {
            //get horizontal face's reference
            FaceArray faces = GeomUtil.GetFaces(floor);

            foreach (Face face in faces)
            {
                if (GeomUtil.IsHorizontalFace(face))
                {
                    refer = face.Reference;
                    break;
                }
            }
            if (null == refer)
            {
                return(false);
            }
            //get analytical model profile
            AnalyticalPanel model    = null;
            Document        document = floor.Document;
            AnalyticalToPhysicalAssociationManager assocManager = AnalyticalToPhysicalAssociationManager.GetAnalyticalToPhysicalAssociationManager(document);

            if (assocManager != null)
            {
                ElementId associatedElementId = assocManager.GetAssociatedElementId(floor.Id);
                if (associatedElementId != ElementId.InvalidElementId)
                {
                    Element associatedElement = document.GetElement(associatedElementId);
                    if (associatedElement != null && associatedElement is AnalyticalPanel)
                    {
                        model = associatedElement as AnalyticalPanel;
                    }
                }
            }
            if (null == model)
            {
                return(false);
            }

            curves = model.GetOuterContour().ToList();
            if (!GeomUtil.IsRectangular(curves))
            {
                return(false);
            }
            curves = AddInlaidCurves(curves, 0.5);

            return(true);
        }