Open ashvinisawantsofttechengr opened 3 months ago
Can we use folowing function to get all face points of any building elements and how?
public Dictionary<string, List<List<Point>>> GetFacesOfASpace(string spaceGuid) { Dictionary<string, List<List<Point>>> faces = new Dictionary<string, List<List<Point>>>(); XbimGeometryEngine engine = new XbimGeometryEngine(); PointOperator objOp = new PointOperator(); try { IfcSpace spc = _mObjModelIFCStore.Instances.Where<IfcSpace>(rel => rel.GlobalId == spaceGuid).FirstOrDefault(); var representations = spc.Representation.Representations; XbimMatrix3D plc = GenerateLocRefMatrixOfObject(spc);//To use in converting local to global coordinates foreach (IfcShapeRepresentation shapeRepresentation in representations) { IfcShapeRepresentation rep = (IfcShapeRepresentation)shapeRepresentation; IXbimSolid objectSolid = null; if (shapeRepresentation.RepresentationType == "SweptSolid") { List<Point> extPoints = new List<Point>(); IfcExtrudedAreaSolid solid = (IfcExtrudedAreaSolid)rep.Items.ElementAt(0); objectSolid = engine.CreateSolid((IfcExtrudedAreaSolid)solid, null); faces = GetExtFacesOfAFaceSet(objectSolid, plc); } else if(shapeRepresentation.RepresentationType == "AdvancedBrep") { IfcAdvancedBrep advancedBRep = (IfcAdvancedBrep)rep.Items.ElementAt(0); objectSolid = engine.CreateSolid((IfcAdvancedBrep)advancedBRep, null); faces = GetExtFacesOfAFaceSet(objectSolid, plc); } } } catch (Exception ex) { log.Error(ex); #if DEBUG throw; #endif } return faces; }
Yes you can, but these points will only be defined in local coordinate system and you may miss other possible types of geometry representations.
Can we use folowing function to get all face points of any building elements and how?