/// <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 reference FaceArray faces = GeomUtil.GetFaces(floor); foreach (Face face in faces) { if (GeomUtil.IsHorizontalFace(face)) { refer = face.Reference; break; } } //no proper reference if (null == refer) { return(false); } //check the analytical model profile is rectangular AnalyticalModel model = floor.GetAnalyticalModel(); if (null == model) { return(false); } curves = model.GetCurves(AnalyticalCurveType.ActiveCurves); if (!GeomUtil.IsRectangular(curves)) { return(false); } return(true); }
/// <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 reference FaceArray faces = GeomUtil.GetFaces(floor); foreach (Face face in faces) { if (GeomUtil.IsHorizontalFace(face)) { refer = face.Reference; break; } } //no proper reference if (null == refer) { return(false); } //check the analytical model profile is rectangular //check the analytical model profile is rectangular Document document = floor.Document; AnalyticalToPhysicalAssociationManager assocManager = AnalyticalToPhysicalAssociationManager.GetAnalyticalToPhysicalAssociationManager(document); AnalyticalPanel model = null; 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); } return(true); }