protected override void GenerateData(DatabaseIfc db, IfcBuilding building) { IfcBeamType beamType = GetParametericIPE200(db); IfcMaterialProfileSet materialProfileSet = beamType.MaterialSelect as IfcMaterialProfileSet; IfcBeamStandardCase beamStandardCase = new IfcBeamStandardCase(building, new IfcMaterialProfileSetUsage(materialProfileSet, IfcCardinalPointReference.MID), new IfcAxis2Placement3D(new IfcCartesianPoint(db, 0, 0, 0), db.Factory.YAxis, db.Factory.XAxisNegative), 1000) { GlobalId = "0uo2yx7G19uwCu9sIjn6DQ", Name = beamType.Name, RelatingType = beamType }; db.NextObjectRecord = 300; string name = "CHS219.1x6.3"; IfcCircleHollowProfileDef chs219x6 = new IfcCircleHollowProfileDef(db, name, 219.1 / 2.0, 6.3); materialProfileSet = beamType.MaterialSelect as IfcMaterialProfileSet; IfcMaterialProfile materialProfile2 = new IfcMaterialProfile(name, materialProfileSet.MaterialProfiles[0].Material, chs219x6); IfcBeamType beamType2 = new IfcBeamType(name, materialProfile2, IfcBeamTypeEnum.BEAM) { GlobalId = "3l_OKNTJr4yBOR5rYl6b9w" }; materialProfileSet = beamType2.MaterialSelect as IfcMaterialProfileSet; IfcBeamStandardCase beamStandardCase2 = new IfcBeamStandardCase(building, new IfcMaterialProfileSetUsage(materialProfileSet, IfcCardinalPointReference.MID), new IfcAxis2Placement3D(new IfcCartesianPoint(db, 500, 0, 0), db.Factory.YAxis, db.Factory.XAxisNegative), 1000) { GlobalId = "3_NFDdmqr7mxekvlvcgwa7", Name = name, RelatingType = beamType2 }; //Unique ids assigned to generate constant IfcScript sample files, remove otherwise beamStandardCase.MaterialSelect.Associates.GlobalId = "2SL41bR1rCj99SIKuKXeFl"; beamType.ObjectTypeOf.GlobalId = "3s_DqAVvb3LguudTShJHVo"; beamType.MaterialSelect.Associates.GlobalId = "3tlx8qcefDouGWiGFgBV8d"; beamType2.ObjectTypeOf.GlobalId = "3LrutsCpn4DPF9Zt4YdIEU"; beamType2.MaterialSelect.Associates.GlobalId = "14nDe0n1bErgiI78N83Oxd"; beamStandardCase2.MaterialSelect.Associates.GlobalId = "1Set5Cyu9BFOWznvoQe1ho"; }
protected override void GenerateData(DatabaseIfc database, IfcBuilding building) { IfcBeamType beamType = GetParametericIPE200(database); IfcMaterialProfileSet materialProfileSet = beamType.MaterialSelect as IfcMaterialProfileSet; IfcBeamStandardCase beamStandardCase1 = new IfcBeamStandardCase(building, new IfcMaterialProfileSetUsage(materialProfileSet, IfcCardinalPointReference.TOPMID), new IfcAxis2Placement3D(new IfcCartesianPoint(database, 0, 0, 0), database.Factory.YAxis, database.Factory.XAxisNegative), 1000) { GlobalId = "2YX3YEaA13qOf$B1iBgAf6", Name = "TopMid", RelatingType = beamType }; IfcBeamStandardCase beamStandardCase2 = new IfcBeamStandardCase(building, new IfcMaterialProfileSetUsage(materialProfileSet, IfcCardinalPointReference.BOTMID), new IfcAxis2Placement3D(new IfcCartesianPoint(database, 0, 0, 0), database.Factory.YAxis, database.Factory.XAxisNegative), 1000) { GlobalId = "39IDqhhC14BxCj_Ryk$esj", Name = "BotMid", RelatingType = beamType }; IfcBeamStandardCase beamStandardCase3 = new IfcBeamStandardCase(building, new IfcMaterialProfileSetUsage(materialProfileSet, IfcCardinalPointReference.BOTLEFT), new IfcAxis2Placement3D(new IfcCartesianPoint(database, 500, 0, 0), database.Factory.YAxis, database.Factory.XAxisNegative), 1000) { GlobalId = "17CqI$IjrDARuaYNcWcoRH", Name = "BotLeft", RelatingType = beamType }; IfcBeamStandardCase beamStandardCase4 = new IfcBeamStandardCase(building, new IfcMaterialProfileSetUsage(materialProfileSet, IfcCardinalPointReference.TOPRIGHT), new IfcAxis2Placement3D(new IfcCartesianPoint(database, 500, 0, 0), database.Factory.YAxis, database.Factory.XAxisNegative), 1000) { GlobalId = "3TOzuh11rACgRkioYYOjj5", Name = "TopRight", RelatingType = beamType }; //Unique ids assigned to generate constant IfcScript sample files, remove otherwise beamStandardCase1.MaterialSelect.Associates.GlobalId = "2v53tpkKfC1QI$UVEwGxEy"; beamStandardCase2.MaterialSelect.Associates.GlobalId = "2GHGDnjC1BI8mr5FS1ysvq"; beamStandardCase3.MaterialSelect.Associates.GlobalId = "1v094xksfDT9bOdSPNsjLB"; beamStandardCase4.MaterialSelect.Associates.GlobalId = "0ys4PwYgT5dAduf$ECulk$"; }
protected override void GenerateData(STPModelData md, IfcBuilding building) { IfcBeamType beamType = GetParametericIPE200(md); IfcBeamStandardCase beamStandardCase = new IfcBeamStandardCase(building, beamType, new Line(0, 0, 0, 0, 1000, 0), Vector3d.ZAxis, IfcCardinalPointReference.TOPMID, new List <Plane>()) { GlobalId = "2YX3YEaA13qOf$B1iBgAf6", Name = "TopMid" }; beamStandardCase.Material.Associates.GlobalId = "2v53tpkKfC1QI$UVEwGxEy"; IfcBeamStandardCase beamStandardCase2 = new IfcBeamStandardCase(building, beamType, new Line(0, 0, 0, 0, 1000, 0), Vector3d.ZAxis, IfcCardinalPointReference.BOTMID, new List <Plane>()) { GlobalId = "39IDqhhC14BxCj_Ryk$esj", Name = "BotMid" }; beamStandardCase2.Material.Associates.GlobalId = "2GHGDnjC1BI8mr5FS1ysvq"; IfcBeamStandardCase beamStandardCase3 = new IfcBeamStandardCase(building, beamType, new Line(500, 0, 0, 500, 1000, 0), Vector3d.ZAxis, IfcCardinalPointReference.BOTLEFT, new List <Plane>()) { GlobalId = "17CqI$IjrDARuaYNcWcoRH", Name = "BotLeft" }; beamStandardCase3.Material.Associates.GlobalId = "1v094xksfDT9bOdSPNsjLB"; IfcBeamStandardCase beamStandardCase4 = new IfcBeamStandardCase(building, beamType, new Line(500, 0, 0, 500, 1000, 0), Vector3d.ZAxis, IfcCardinalPointReference.TOPRIGHT, new List <Plane>()) { GlobalId = "3TOzuh11rACgRkioYYOjj5", Name = "TopRight" }; beamStandardCase4.Material.Associates.GlobalId = "0ys4PwYgT5dAduf$ECulk$"; }
protected override void GenerateData(STPModelData md, IfcBuilding building) { IfcBeamType beamType = GetParametericIPE200(md); IfcBeamStandardCase beamStandardCase = new IfcBeamStandardCase(building, beamType, new Line(0, 0, 0, 0, 1000, 0), Vector3d.ZAxis, IfcCardinalPointReference.MID, new List <Plane>()) { GlobalId = "0uo2yx7G19uwCu9sIjn6DQ", Name = beamType.Name }; beamStandardCase.Material.Associates.GlobalId = "2SL41bR1rCj99SIKuKXeFl"; md.NextObjectRecord = 300; string name = "CHS219.1x6.3"; IfcCircleHollowProfileDef chs219x6 = new IfcCircleHollowProfileDef(md, name, 219.1 / 2.0, 6.3); IfcMaterialProfileSet materialProfileSet = beamType.MaterialSelect as IfcMaterialProfileSet; IfcMaterialProfile materialProfile2 = new IfcMaterialProfile(md, name, "", materialProfileSet.MaterialProfiles[0].Material, chs219x6, 0, ""); IfcBeamType beamType2 = new IfcBeamType(name, materialProfile2, IfcBeamTypeEnum.BEAM) { GlobalId = "3l_OKNTJr4yBOR5rYl6b9w" }; beamType2.ObjectTypeOf.GlobalId = "3LrutsCpn4DPF9Zt4YdIEU"; beamType2.Material.Associates.GlobalId = "14nDe0n1bErgiI78N83Oxd"; IfcBeamStandardCase beamStandardCase2 = new IfcBeamStandardCase(building, beamType2, new Line(500, 0, 0, 500, 1000, 0), Vector3d.ZAxis, IfcCardinalPointReference.MID, new List <Plane>()) { GlobalId = "3_NFDdmqr7mxekvlvcgwa7", Name = name }; beamStandardCase2.Material.Associates.GlobalId = "1Set5Cyu9BFOWznvoQe1ho"; }
protected override void GenerateData(STPModelData md, IfcBuilding building) { IfcBeamType beamType = GetParametericIPE200(md); IfcBeamStandardCase beamStandardCase = new IfcBeamStandardCase(building, new IfcElemParams("0a_qfeQLDA8e5qT$Do6J_t", "Extrusion", "", "", ""), beamType, new Line(0, 0, 0, 0, 1000, 0), Vector3d.ZAxis, IfcCardinalPointReference.TOPMID, new List <Plane>()); beamStandardCase.Material.Associates.GlobalId = "2uxxMWfA51AAznk5bQJylf"; IfcBeamStandardCase beamStandardCase2 = new IfcBeamStandardCase(building, new IfcElemParams("1zqFh80l11VgfEm3ZWh6Xv", "Revolution", "", "", ""), beamType, new Arc(new Point3d(0, 0, 400), new Point3d(-100, 500, 400), new Point3d(0, 1000, 400)), Vector3d.ZAxis, IfcCardinalPointReference.TOPMID, new List <Plane>()); }
protected IfcBeamType GetParametericIPE200(STPModelData md) { IfcMaterialProfile materialProfile = GetParametericIPE200Profile(md); IfcBeamType beamType = new IfcBeamType(materialProfile.Name, materialProfile, IfcBeamTypeEnum.JOIST) { GlobalId = "32b2OtzCP30umNyY5LsCfN" }; beamType.ObjectTypeOf.GlobalId = "3s_DqAVvb3LguudTShJHVo"; beamType.Material.Associates.GlobalId = "0NkGSIHVT3SeAR6bnw7pSa"; return beamType; }
internal static void GenerateData(STPModelData md, IfcBuilding building,bool assembly) { IfcDocumentReference documentReference = new IfcDocumentReference(md, "", "MyReinforcementCode", "MyCodeISO3766", "", null); IfcRelAssociatesDocument associatesDocument = new IfcRelAssociatesDocument(md.Project, documentReference); associatesDocument.GlobalId = "1R7R97$uLAAv4wci$KGwn8"; IfcMaterial material = new IfcMaterial(md, "ReinforcingSteel", "", ""); List<Point3d> points = new List<Point3d>() { new Point3d(-69.0, 0.0, -122.0), new Point3d(-69.0, 0.0, -79.0), new Point3d(-54.9411254969541, 0.0, -45.0588745030455), new Point3d(-21.0, 0.0, -31.0), new Point3d(21.0, 0.0, -31.0), new Point3d(54.9411254969541, 0.0, -45.0588745030455), new Point3d(69.0, 0.0, -78.9999999999999), new Point3d(69.0, 0.00000000000000089, -321.0), new Point3d(54.9939785957165, 1.21791490472034, -354.941125496954), new Point3d(21.1804517666074, 4.15822158551252, -369.0), new Point3d(-20.6616529376114, 7.79666547283599, -369.0), new Point3d(-54.4751797667207, 10.7369721536282, -354.941125496954), new Point3d(-68.4812011710042, 11.9548870583485, -321.0), new Point3d(-69.0, 12.0, -79.0), new Point3d(-54.9411254969541, 12.0, -45.0588745030455), new Point3d(-21.0, 12.0, -31.0), new Point3d(21.0, 12.0, -31.0), new Point3d(54.9411254969541, 12.0, -45.0588745030455), new Point3d(69.0, 12.0, -78.9999999999999),new Point3d(69.0, 12.0, -122.0), }; PolyCurve pc = new PolyCurve(); pc.Append(new Line(points[0],points[1])); pc.Append(new Arc(points[1],points[2],points[3] )); pc.Append(new Line(points[3],points[4])); pc.Append(new Arc(points[4],points[5],points[6] )); pc.Append(new Line(points[6],points[7])); pc.Append(new Arc(points[7],points[8],points[9] )); pc.Append(new Line(points[9],points[10])); pc.Append(new Arc(points[10],points[11],points[12] )); pc.Append(new Line(points[12],points[13])); pc.Append(new Arc(points[13],points[14],points[15] )); pc.Append(new Line(points[15],points[16])); pc.Append(new Arc(points[16],points[17],points[18] )); pc.Append(new Line(points[18],points[19])); IfcBoundedCurve directrix = IfcBoundedCurve.ConvertCurve(md,pc); double barDiameter = 12, area = Math.PI * Math.Pow( barDiameter,2) / 4; IfcSweptDiskSolid sweptDiskSolid = new IfcSweptDiskSolid(directrix, barDiameter/2.0, 0); IfcRepresentationMap representationMap = new IfcRepresentationMap(sweptDiskSolid); string shapeCode = ""; //Todo IfcReinforcingBarType reinforcingBarType = new IfcReinforcingBarType(md, "12 Diameter Ligature", IfcReinforcingBarTypeEnum.LIGATURE, barDiameter, area, 1150, IfcReinforcingBarSurfaceEnum.TEXTURED, shapeCode, null) { GlobalId = "0jMRtfHYXE7u4s_CQ2uVE9", MaterialSelect = material, RepresentationMaps = new List<IfcRepresentationMap>() { representationMap} }; reinforcingBarType.ObjectTypeOf.GlobalId = "1iAfl2ERbFmwi7uniy1H7j"; reinforcingBarType.Material.Associates.GlobalId = "3gfVO40P5EfQyKZ_bF0R$6"; if (assembly) { IfcMaterial concrete = new IfcMaterial(md,"Concrete","","Concrete"); string name = "400x200RC"; IfcRectangleProfileDef rectangleProfileDef = new IfcRectangleProfileDef(md, name, 400, 200); IfcMaterialProfile materialProfile = new IfcMaterialProfile(md,name,"",concrete,rectangleProfileDef,0,""); IfcBeamType beamType = new IfcBeamType(name, materialProfile, IfcBeamTypeEnum.BEAM) { GlobalId = "3bdpqVuWTCbxJ2S3ODYv6q"}; beamType.ObjectTypeOf.GlobalId = "2oaQVVf79BrwRouvtRuQVg"; beamType.Material.Associates.GlobalId = "2ZEgyI2v184hwa$_diRqS9"; IfcBeamStandardCase beamStandardCase = new IfcBeamStandardCase(building, beamType, new Line(0, 0, 0, 0, 5000, 0), Vector3d.ZAxis, IfcCardinalPointReference.TOPMID, null) { GlobalId = "1yjQ2DwLnCC8k3i3X6D_ut" }; beamStandardCase.Material.Associates.GlobalId = "3DWeleqqjEG9KshbOZXUdY"; IfcElementAssembly elementAssembly = new IfcElementAssembly(beamStandardCase, IfcAssemblyPlaceEnum.FACTORY, IfcElementAssemblyTypeEnum.REINFORCEMENT_UNIT) { GlobalId = "0Q1tCJWdj4kOkZUg7rkf2h" }; List<string> ids = new List<string>() { "0ohBfsArr3ruXYxacT4yl5","3YrK7RbE122fNRsP5djFAe","0wxAc63nj5AezFhfks7wLL","0bsov2wZL6tRRZmKy4vuUU","3qrgfIBb92ZegJTle7jou3","16m6R3JeT83fJPCze2yU$a","2SGIIYjSbCuu3HVwoLt1yh","0PsLby6eL8_hVEt4QwK0lZ","1325VJou5AngWp1djcV0hL","20zj_$BcH74xRgR4bDrLNb","3M4SfEMtHEJukgZR4hw$eV","23BYnIaOLBZPVTrKVEDJiy","2XulRByDL8ugyo4Uqv9rJr","2xvQMSga96XOT3VeCS6ZsK","2gUE6_w3j77f8YJGz_2RMl","0J0dRL4tT93REAabfASDom","048RJ151b81PqODsTMD4EA","3hXx9Kb6b5bvjgr9pwvpz0","0FmUHg8ZX0ZfY$0f5nkM2l","2_zvpwRdvAuRiTlHXX$Qp8","1mhkXHKfX6PxdS2vZn17wX","0CeIQzUqP5qOOeAjMtH2OX","3shtoAQL5BAhvwA_1Ph$lC","22j4RNKqD2IBRDGig5eaCF","3Wvu6qGJH4ChhTV3pl9CGh","37Qrf07Iz3tRMbSxEA4ynH","2gelqZ1Wv8BvCy6TstVGkd","1Q21dHc_X7eRppCHrT69Vb","0e6Wc08NLD59ueqCAK1gxp","3xdMOSZMj3cBOV_QTbXZha","1r_U9JTkHDWwkv_nfWFHVe","29I7_S2fT3WRD4zPH4YjmD","0$ciATTaP17PJMHQD0$N3Y","1irBeCCUf82wdGg7qTPCbW" }; int jcounter = 0; for (int icounter = 25; icounter < 5000; icounter += 150) { IfcElement element = reinforcingBarType.GenerateMappedItemElement(elementAssembly, new Plane(new Point3d(0, icounter, 0), Vector3d.XAxis, Vector3d.YAxis)); element.GlobalId = ids[jcounter++]; } elementAssembly.IsDecomposedBy[0].GlobalId = "1WdB196Kb72f_pKgj5rklU"; } else { IfcElement element = reinforcingBarType.GenerateMappedItemElement(building, Plane.WorldXY); element.GlobalId = "0WUveBtSTDbunNjDLsuRn$"; } }
protected override void GenerateInstance(IfcBuilding building) { DatabaseIfc database = building.Database; IfcBeamType beamType = GetParametericIPE200(database); IfcMaterialProfileSet materialProfileSet = beamType.MaterialSelect as IfcMaterialProfileSet; IfcAxis2Placement3D axis2dPlacement3d = new IfcAxis2Placement3D(new IfcCartesianPoint(database, 0, 0, 0), database.Factory.YAxis, database.Factory.XAxisNegative); IfcMaterialProfileSetUsage materialProfileSetUsage = new IfcMaterialProfileSetUsage(materialProfileSet, IfcCardinalPointReference.TOPMID); //IfcBeam beam = new IfcBeam(building,materialProfileSetUsage, axis2dPlacement3d, 1000) { Name = beamType.Name, RelatingType = beamType }; }
private static IfcBeam CreateBeam(XbimModel model, HndzStructuralElement genericProducthndz) { using (XbimReadWriteTransaction txn = model.BeginTransaction("Create" + genericProducthndz.ToString())) { IfcBeam genericProductIfc = model.Instances.New <IfcBeam>(); IfcExtrudedAreaSolid body = model.Instances.New <IfcExtrudedAreaSolid>(); IfcBeamType elementType = model.Instances.New <IfcBeamType>(); elementType.PredefinedType = IfcBeamTypeEnum.BEAM; if (genericProducthndz.Profile is HndzRectangularProfile) { HndzRectangularProfile genericProfilehndz = genericProducthndz.Profile as HndzRectangularProfile; IfcRectangleProfileDef ifcGenericProfile = AssignRectangularProfile(model, genericProducthndz, genericProductIfc, elementType, genericProfilehndz); //model as a swept area solid body.SweptArea = ifcGenericProfile; } if (genericProducthndz.Profile is HndzISectionProfile) { HndzISectionProfile genericProfilehndz = genericProducthndz.Profile as HndzISectionProfile; IfcIShapeProfileDef ifcGenericProfile = AssignIProfile(model, genericProducthndz, genericProductIfc, elementType, genericProfilehndz); //model as a swept area solid body.SweptArea = ifcGenericProfile; } if (genericProducthndz.Profile is HndzCSectionProfile) { HndzCSectionProfile genericProfilehndz = genericProducthndz.Profile as HndzCSectionProfile; IfcCShapeProfileDef ifcGenericProfile = AssignCsectionProfile(model, genericProducthndz, genericProductIfc, elementType, genericProfilehndz); //model as a swept area solid body.SweptArea = ifcGenericProfile; } AdjustExtrusion(model, body, genericProducthndz, genericProductIfc); if (model.Validate(txn.Modified(), Console.Out) == 0) { txn.Commit(); return(genericProductIfc); } return(null); } }
protected override void GenerateData(STPModelData md, IfcBuilding building) { IfcBeamType beamType = GetParametericIPE200(md); IfcBeamStandardCase beamStandardCase = new IfcBeamStandardCase(building, beamType, new Line(0, 0, 0, 0, 1000, 0), Vector3d.ZAxis, IfcCardinalPointReference.MID, new List<Plane>()) {GlobalId = "0uo2yx7G19uwCu9sIjn6DQ", Name = beamType.Name }; beamStandardCase.Material.Associates.GlobalId = "2SL41bR1rCj99SIKuKXeFl"; md.NextObjectRecord = 300; string name = "CHS219.1x6.3"; IfcCircleHollowProfileDef chs219x6 = new IfcCircleHollowProfileDef(md, name, 219.1 / 2.0, 6.3); IfcMaterialProfileSet materialProfileSet = beamType.MaterialSelect as IfcMaterialProfileSet; IfcMaterialProfile materialProfile2 = new IfcMaterialProfile(md, name, "", materialProfileSet.MaterialProfiles[0].Material, chs219x6, 0, ""); IfcBeamType beamType2 = new IfcBeamType(name, materialProfile2, IfcBeamTypeEnum.BEAM) { GlobalId = "3l_OKNTJr4yBOR5rYl6b9w" }; beamType2.ObjectTypeOf.GlobalId = "3LrutsCpn4DPF9Zt4YdIEU"; beamType2.Material.Associates.GlobalId = "14nDe0n1bErgiI78N83Oxd"; IfcBeamStandardCase beamStandardCase2 = new IfcBeamStandardCase(building, beamType2, new Line(500, 0, 0, 500, 1000, 0), Vector3d.ZAxis, IfcCardinalPointReference.MID, new List<Plane>()) { GlobalId = "3_NFDdmqr7mxekvlvcgwa7", Name = name }; beamStandardCase2.Material.Associates.GlobalId = "1Set5Cyu9BFOWznvoQe1ho"; }
protected override void GenerateData(DatabaseIfc database, IfcBuilding building) { IfcBeamType beamType = GetParametericIPE200(database); IfcMaterialProfileSetUsage materialProfileSetUsage = new IfcMaterialProfileSetUsage(beamType.MaterialSelect as IfcMaterialProfileSet, IfcCardinalPointReference.TOPMID); IfcBeamStandardCase beamStandardCase = new IfcBeamStandardCase(building, materialProfileSetUsage, new IfcAxis2Placement3D(new IfcCartesianPoint(database, 0, 0, 0), database.Factory.YAxis, database.Factory.XAxisNegative), 1000) { GlobalId = "0a_qfeQLDA8e5qT$Do6J_t", Name = "Extrusion", RelatingType = beamType }; IfcBeamStandardCase beamStandardCase2 = new IfcBeamStandardCase(building, materialProfileSetUsage, new IfcAxis2Placement3D(new IfcCartesianPoint(database, 0, 0, 400), new IfcDirection(database, -0.38461538, 0.92307692, 0), new IfcDirection(database, -0.92307692, -0.38461538, 0)), new Tuple <double, double>(-1300, 0), 0.789582239399523) { GlobalId = "1zqFh80l11VgfEm3ZWh6Xv", Name = "Revolution", RelatingType = beamType }; //Unique ids assigned to generate constant IfcScript sample files, remove otherwise beamStandardCase.MaterialSelect.Associates.GlobalId = "2uxxMWfA51AAznk5bQJylf"; }
internal static DatabaseIfc Generate(ModelView mdv, string path) { DatabaseIfc db = new DatabaseIfc(true, mdv); //IfcGeometricRepresentationContext //IfcCartesianPoint //IfcAxis2Placement3D //IfcDirection //IfcAxis2Placement2D //IfcSIUnit //IfcLocalPlacement IfcSite site = new IfcSite(db, "TestSite"); //IfcPerson NOT RV //IfcOrganization NOT RV //IfcPersonAndOrganization NOT RV //IfcOwnerHistory NOT RV //fcApplication NOT RV // IfcProjectLibrary NOT RV Can't have multiple context IfcProject project = new IfcProject(site, "TestProject", IfcUnitAssignment.Length.Millimetre) { }; //IfcUnitAssignment //IfcRelAggregates IfcBuilding building = new IfcBuilding(site, "TestBuilding") { }; IfcBuildingStorey buildingStorey = new IfcBuildingStorey(building, "TestBuildingStorey", 3000); IfcSpace space = new IfcSpace(buildingStorey, null, null) { Name = "TestSpace" }; space.RelatingType = new IfcSpaceType(db, "TestSpaceType", IfcSpaceTypeEnum.INTERNAL); IfcZone zone = new IfcZone(buildingStorey, "TestZone", "TestZoneLongName", new List <IfcSpace>() { space }); IfcLocalPlacement localPlacement = buildingStorey.Placement as IfcLocalPlacement; IfcMaterial material = new IfcMaterial(db, "TestMaterial") { Description = "TestDescription", Category = "TestCategory" }; IfcMaterialProperties materialProperties = new IfcMaterialProperties("TestMaterialProperties", material); materialProperties.AddProperty(new IfcPropertySingleValue(db, "MassDensity", new IfcMassDensityMeasure(1))); IfcSurfaceStyleShading surfaceStyleShading = new IfcSurfaceStyleShading(new IfcColourRgb(db, 1, 0, 0) { Name = "Red" }); IfcSurfaceStyle surfaceStyle = new IfcSurfaceStyle(surfaceStyleShading, null, null, null, null); IfcMaterialDefinitionRepresentation materialDefinitionRepresentation = new IfcMaterialDefinitionRepresentation(new IfcStyledRepresentation(new IfcStyledItem(surfaceStyle) { Name = "TestStyledItem" }), material); IfcIndexedPolyCurve indexedPolyCurve = IPE200Curve(db); IfcArbitraryClosedProfileDef arbitraryClosedProfileDef = new IfcArbitraryClosedProfileDef("IPE200", indexedPolyCurve); IfcMaterialProfile materialProfile = new IfcMaterialProfile("TestMaterialProfile", material, arbitraryClosedProfileDef); IfcMaterialProfileSet materialProfileSet = new IfcMaterialProfileSet("TestMaterialProfileSet", materialProfile); IfcExtrudedAreaSolid extrudedAreaSolid = new IfcExtrudedAreaSolid(arbitraryClosedProfileDef, new IfcAxis2Placement3D(new IfcCartesianPoint(db, 0, 0, 0), new IfcDirection(db, 1, 0, 0), new IfcDirection(db, 0, 1, 0)), new IfcDirection(db, 0, 0, 1), 5000); IfcBeamType beamType = new IfcBeamType(db, "TestBeamType", IfcBeamTypeEnum.BEAM); beamType.MaterialSelect = materialProfileSet; IfcBeam beam = new IfcBeam(buildingStorey, new IfcLocalPlacement(localPlacement, new IfcAxis2Placement3D(new IfcCartesianPoint(db, 1000, 2000, 0)) { RefDirection = new IfcDirection(db, 0, 1, 0) }), new IfcProductDefinitionShape(new IfcShapeRepresentation(extrudedAreaSolid))); //IfcGeometricRepresentationSubContext beam.RelatingType = beamType; //IfcRelDefinesByType // if(mdv != ModelView.Ifc4Reference) // IfcActorRole NOT RV //IfcActuator //IfcActuatorType //IfcAdvancedBrep NOT RV //IfcAdvancedFace NOT RV //IfcAirTerminal //IfcAirTerminalBox //IfcAirTerminalBoxType //IfcAirTerminalType //IfcAirToAirHeatRecovery //IfcAirToAirHeatRecoveryType //IfcAlarm //IfcAlarmType //IfcArbitraryOpenProfileDef //IfcArbitraryProfileDefWithVoids //IfcAsymmetricIShapeProfileDef NOT RV //IfcAudioVisualAppliance //IfcAudioVisualApplianceType //IfcAxis1Placement //IfcBeamStandardCase NOT RV //IfcBlock NOT RV //IfcBoiler //IfcBoilerType //IfcBooleanClippingResult NOT RV //IfcBooleanResult NOT RV //IfcBSplineCurveWithKnots NOT RV //IfcBSplineSurface NOT RV //IfcBSplineSurfaceWithKnots NOT RV //IfcBuildingElementPart //IfcBuildingElementPartType //IfcBuildingElementProxy //IfcBuildingElementProxyType //IfcBuildingSystem //IfcBurner //IfcBurnerType //IfcCableCarrierFitting //IfcCableCarrierFittingType //IfcCableCarrierSegment //IfcCableCarrierSegmentType //IfcCableFitting //IfcCableFittingType //IfcCableSegment //IfcCableSegmentType //IfcCartesianPointList2D //IfcCartesianPointList3D //IfcCartesianTransformationOperator2D //IfcCartesianTransformationOperator2DnonUniform //IfcCartesianTransformationOperator3D //IfcCartesianTransformationOperator3DnonUniform //IfcCenterLineProfileDef //IfcChiller //IfcChillerType //IfcChimney //IfcChimneyType //IfcCircle //IfcCircleHollowProfileDef NOT RV //IfcCircleProfileDef NOT RV //IfcCivilElement //IfcCivilElementType //IfcClassification //IfcClassificationReference //IfcClosedShell //IfcCoil //IfcCoilType //IfcColourRgbList //IfcColourSpecification //IfcColumn //IfcColumnStandardCase NOT RV //IfcColumnType //IfcCommunicationsAppliance //IfcCommunicationsApplianceType //IfcComplexProperty //IfcCompositeProfileDef NOT RV //IfcCompressor //IfcCompressorType //IfcCondenser //IfcCondenserType //IfcConnectedFaceSet NOT RV //IfcConnectionCurveGeometry NOT RV //IfcConnectionVolumeGeometry NOT RV //IfcController //IfcControllerType //IfcConversionBasedUnit //IfcConversionBasedUnitWithOffset //IfcCooledBeam //IfcCooledBeamType //IfcCoolingTower //IfcCoolingTowerType //IfcCovering //IfcCoveringType //IfcCsgSolid NOT RV //IfcCShapeProfileDef NOT RV //IfcCurtainWall //IfcCurtainWallType //IfcCurveStyle //IfcCurveStyleFont //IfcCurveStyleFontPattern //IfcDamper //IfcDamperType //IfcDerivedProfileDef NOT RV //IfcDerivedUnit //IfcDerivedUnitElement //IfcDimensionalExponents //IfcDiscreteAccessory //IfcDiscreteAccessoryType //IfcDistributionChamberElement //IfcDistributionChamberElementType //IfcDistributionCircuit //IfcDistributionControlElement //IfcDistributionControlElementType //IfcDistributionElement //IfcDistributionElementType //IfcDistributionFlowElement //IfcDistributionFlowElementType //IfcDistributionPort //IfcDistributionSystem //IfcDocumentReference //IfcDoor //IfcDoorLiningProperties //IfcDoorPanelProperties //IfcDoorStandardCase NOT RV //IfcDoorType //IfcDuctFitting //IfcDuctFittingType //IfcDuctSegment //IfcDuctSegmentType //IfcDuctSilencer //IfcDuctSilencerType //IfcEdge NOT RV //IfcEdgeCurve NOT RV //IfcEdgeLoop NOT RV //IfcElectricAppliance //IfcElectricApplianceType //IfcElectricDistributionBoard //IfcElectricDistributionBoardType //IfcElectricFlowStorageDevice //IfcElectricFlowStorageDeviceType //IfcElectricGenerator //IfcElectricGeneratorType //IfcElectricMotor //IfcElectricMotorType //IfcElectricTimeControl //IfcElectricTimeControlType //IfcElementAssembly //IfcElementAssemblyType //IfcElementComponent //IfcElementComponentType //IfcElementQuantity //IfcEllipseProfileDef NOT RV //IfcEnergyConversionDevice //IfcEnergyConversionDeviceType //IfcEngine //IfcEngineType //IfcEvaporativeCooler //IfcEvaporativeCoolerType //IfcEvaporator //IfcEvaporatorType //IfcExtendedProperties //IfcExternalInformation //IfcExternalReference //IfcExtrudedAreaSolidTapered NOT RV //IfcFace NOT RV //IfcFaceBasedSurfaceModel NOT RV //IfcFaceBound NOT RV //IfcFaceOuterBound NOT RV //IfcFaceSurface NOT RV //IfcFacetedBrep NOT RV //IfcFan //IfcFanType //IfcFastener //IfcFastenerType //IfcFeatureElement //IfcFeatureElementAddition NOT RV //IfcFeatureElementSubtraction //IfcFillAreaStyle //IfcFillAreaStyleHatching //IfcFilter //IfcFilterType //IfcFireSuppressionTerminal //IfcFireSuppressionTerminalType //IfcFixedReferenceSweptAreaSolid NOT RV //IfcFlowController //IfcFlowControllerType //IfcFlowFitting //IfcFlowFittingType //IfcFlowInstrument //IfcFlowInstrumentType //IfcFlowMeter //IfcFlowMeterType //IfcFlowMovingDevice //IfcFlowMovingDeviceType //IfcFlowSegment //IfcFlowSegmentType //IfcFlowStorageDevice //IfcFlowStorageDeviceType //IfcFlowTerminal //IfcFlowTerminalType //IfcFlowTreatmentDevice //IfcFlowTreatmentDeviceType //IfcFooting //IfcFootingType //IfcFurnishingElement //IfcFurnishingElementType //IfcFurniture //IfcFurnitureType //IfcGeographicElement //IfcGeographicElementType //IfcGeometricCurveSet //IfcGeometricSet //IfcGrid //IfcGridAxis //IfcGridPlacement NOT RV //IfcGroup //IfcHalfSpaceSolid NOT RV //IfcHeatExchanger //IfcHeatExchangerType //IfcHumidifier //IfcHumidifierType //IfcIndexedColourMap //IfcIndexedTextureMap //IfcIndexedTriangleTextureMap //IfcInterceptor //IfcInterceptorType //IfcIShapeProfileDef //IfcJunctionBox //IfcJunctionBoxType //IfcLamp //IfcLampType //IfcLibraryInformation NOT RV //IfcLibraryReference NOT RV //IfcLightFixture //IfcLightFixtureType //IfcLine //IfcLoop NOT RV //IfcLShapeProfileDef NOT RV //IfcMapConversion //IfcMappedItem //IfcMaterialConstituent //IfcMaterialConstituentSet //IfcMaterialLayer //IfcMaterialLayerSet //IfcMaterialLayerSetUsage NOT RV //IfcMaterialLayerWithOffsets NOT RV //IfcMaterialProfileSetUsage NOT RV //IfcMaterialProfileSetUsageTapering NOT RV //IfcMaterialProfileWithOffsets NOT RV //IfcMaterialUsageDefinition NOT RV //IfcMeasureWithUnit //IfcMechanicalFastener //IfcMechanicalFastenerType //IfcMedicalDevice //IfcMedicalDeviceType //IfcMember //IfcMemberStandardCase NOT RV //IfcMemberType //IfcMonetaryUnit //IfcMotorConnection //IfcMotorConnectionType //IfcNamedUnit //IfcOpeningElement //IfcOpeningStandardCase NOT RV //IfcOpenShell NOT RV //IfcOrientedEdge NOT RV //IfcOutlet //IfcOutletType //IfcPcurve NOT RV //IfcPhysicalComplexQuantity //IfcPhysicalQuantity //IfcPhysicalSimpleQuantity //IfcPile //IfcPileType //IfcPipeFitting //IfcPipeFittingType //IfcPipeSegment //IfcPipeSegmentType //IfcPlane NOT RV //IfcPlate //IfcPlateStandardCase NOT RV //IfcPlateType //IfcPoint //IfcPolygonalBoundedHalfSpace NOT RV //IfcPolyline NOT RV //IfcPolyLoop NOT RV //IfcPort //IfcPostalAddress //IfcPreDefinedPropertySet //IfcPresentationItem //IfcPresentationLayerAssignment //IfcPresentationStyle //IfcPresentationStyleAssignment //IfcProductDefinitionShape //IfcProductRepresentation //IfcProfileDef //IfcProfileProperties //IfcProjectedCRS //IfcProjectionElement NOT RV //IfcProperty //IfcPropertyAbstraction //IfcPropertyBoundedValue //IfcPropertyDefinition //IfcPropertyEnumeratedValue //IfcPropertyEnumeration //IfcPropertyListValue //IfcPropertySet //IfcPropertySetTemplate NOT RV //IfcPropertyTableValue //IfcPropertyTemplate NOT RV //IfcPropertyTemplateDefinition NOT RV //IfcProtectiveDevice //IfcProtectiveDeviceTrippingUnit //IfcProtectiveDeviceTrippingUnitType //IfcProtectiveDeviceType //IfcPump //IfcPumpType //IfcQuantityArea //IfcQuantityCount //IfcQuantityLength //IfcQuantitySet //IfcQuantityTime //IfcQuantityVolume //IfcQuantityWeight //IfcRailing //IfcRailingType //IfcRamp //IfcRampFlight //IfcRampFlightType //IfcRampType //IfcRectangleHollowProfileDef NOT RV //IfcRectangleProfileDef NOT RV //IfcRectangularPyramid NOT RV //IfcReinforcingBar //IfcReinforcingBarType //IfcReinforcingElement //IfcReinforcingElementType //IfcReinforcingMesh //IfcReinforcingMeshType //IfcRelAssignsToGroup //IfcRelAssociatesClassification //IfcRelAssociatesDocument //IfcRelAssociatesLibrary NOT RV //IfcRelAssociatesMaterial //IfcRelConnectsElements NOT RV //IfcRelConnectsPathElements NOT RV //IfcRelConnectsPorts //IfcRelConnectsWithRealizingElements NOT RV //IfcRelContainedInSpatialStructure //IfcRelCoversBldgElements //IfcRelDeclares //IfcRelDefinesByProperties //IfcRelFillsElement //IfcRelFlowControlElements NOT RV //IfcRelInterferesElements NOT RV //IfcRelNests //IfcRelProjectsElement NOT RV //IfcRelServicesBuildings //IfcRelVoidsElement //IfcRepresentation //IfcRepresentationContext //IfcRepresentationItem //IfcRepresentationMap //IfcRevolvedAreaSolid //IfcRevolvedAreaSolidTapered NOT RV //IfcRightCircularCone NOT RV //IfcRightCircularCylinder NOT RV //IfcRoof //IfcRoofType //IfcRoundedRectangleProfileDef NOT RV //IfcSanitaryTerminal //IfcSanitaryTerminalType //IfcSensor //IfcSensorType //IfcShadingDevice //IfcShadingDeviceType //IfcShapeRepresentation //IfcShellBasedSurfaceModel NOT RV //IfcSimplePropertyTemplate NOT RV //IfcSlab //IfcSlabElementedCase NOT RV //IfcSlabStandardCase NOT RV //IfcSlabType //IfcSolarDevice //IfcSolarDeviceType //IfcSpaceHeater //IfcSpaceHeaterType //IfcSpatialZone //IfcSpatialZoneType //IfcSphere NOT RV //IfcStackTerminal //IfcStackTerminalType //IfcStair //IfcStairFlight //IfcStairFlightType //IfcStairType //IfcStyleModel //IfcSurface NOT RV //IfcSurfaceCurveSweptAreaSolid NOT RV //IfcSurfaceOfLinearExtrusion NOT RV //IfcSurfaceOfRevolution NOT RV //IfcSurfaceStyleRendering //IfcSurfaceStyleWithTextures surfaceStyleWithTextures = new IfcSurfaceStyleWithTextures(new IfcImageTexture(db,true,true,"")); //IfcSweptDiskSolid //IfcSwitchingDevice //IfcSwitchingDeviceType //IfcSystemFurnitureElement //IfcSystemFurnitureElementType //IfcTank //IfcTankType //IfcTelecomAddress NOT RV //IfcTendon //IfcTendonAnchor //IfcTendonAnchorType //IfcTendonType //IfcTessellatedFaceSet //IfcTessellatedItem //IfcTextureCoordinate //IfcTextureVertexList //IfcTransformer //IfcTransformerType //IfcTransportElement //IfcTransportElementType //IfcTriangulatedFaceSet //IfcTrimmedCurve //IfcTShapeProfileDef NOT RV //IfcTubeBundle //IfcTubeBundleType //IfcUnitaryControlElement //IfcUnitaryControlElementType //IfcUnitaryEquipment //IfcUnitaryEquipmentType //IfcUShapeProfileDef NOT RV //IfcValve //IfcValveType //IfcVector //IfcVertex NOT RV //IfcVertexPoint NOT RV //IfcVibrationIsolator //IfcVibrationIsolatorType //IfcVirtualGridIntersection NOT RV //IfcWall //IfcWallElementedCase NOT RV //IfcWallStandardCase NOT RV //IfcWallType //IfcWasteTerminal //IfcWasteTerminalType //IfcWindow //IfcWindowLiningProperties //IfcWindowPanelProperties //IfcWindowStandardCase NOT RV //IfcWindowType //IfcZShapeProfileDef NOT RV db.WriteFile(Path.Combine(path, mdv.ToString() + ".ifc")); return(db); }
internal static void GenerateInstance(IfcBuilding building, bool assembly) { DatabaseIfc db = building.Database; IfcDocumentReference documentReference = new IfcDocumentReference(db) { Name = "MyReinforcementCode", Identification = "MyCodeISO3766" }; IfcRelAssociatesDocument associatesDocument = new IfcRelAssociatesDocument(db.Project, documentReference) { GlobalId = "1R7R97$uLAAv4wci$KGwn8" }; IfcMaterial material = new IfcMaterial(db, "ReinforcingSteel"); List <Tuple <double, double, double> > points = new List <Tuple <double, double, double> >() { new Tuple <double, double, double>(-69.0, 0.0, -122.0), new Tuple <double, double, double>(-69.0, 0.0, -79.0), new Tuple <double, double, double>(-54.9411254969541, 0.0, -45.0588745030455), new Tuple <double, double, double>(-21.0, 0.0, -31.0), new Tuple <double, double, double>(21.0, 0.0, -31.0), new Tuple <double, double, double>(54.9411254969541, 0.0, -45.0588745030455), new Tuple <double, double, double>(69.0, 0.0, -78.9999999999999), new Tuple <double, double, double>(69.0, 0.00000000000000089, -321.0), new Tuple <double, double, double>(54.9939785957165, 1.21791490472034, -354.941125496954), new Tuple <double, double, double>(21.1804517666074, 4.15822158551252, -369.0), new Tuple <double, double, double>(-20.6616529376114, 7.79666547283599, -369.0), new Tuple <double, double, double>(-54.4751797667207, 10.7369721536282, -354.941125496954), new Tuple <double, double, double>(-68.4812011710042, 11.9548870583485, -321.0), new Tuple <double, double, double>(-69.0, 12.0, -79.0), new Tuple <double, double, double>(-54.9411254969541, 12.0, -45.0588745030455), new Tuple <double, double, double>(-21.0, 12.0, -31.0), new Tuple <double, double, double>(21.0, 12.0, -31.0), new Tuple <double, double, double>(54.9411254969541, 12.0, -45.0588745030455), new Tuple <double, double, double>(69.0, 12.0, -78.9999999999999), new Tuple <double, double, double>(69.0, 12.0, -122.0), }; IfcBoundedCurve directrix = null; if (db.Release == ReleaseVersion.IFC2x3) { directrix = new IfcPolyline(db, points); } else { List <IfcSegmentIndexSelect> segments = new List <IfcSegmentIndexSelect>(); segments.Add(new IfcLineIndex(1, 2)); segments.Add(new IfcArcIndex(2, 3, 4)); segments.Add(new IfcLineIndex(4, 5)); segments.Add(new IfcArcIndex(5, 6, 7)); segments.Add(new IfcLineIndex(7, 8)); segments.Add(new IfcArcIndex(8, 9, 10)); segments.Add(new IfcLineIndex(10, 11)); segments.Add(new IfcArcIndex(11, 12, 13)); segments.Add(new IfcLineIndex(13, 14)); segments.Add(new IfcArcIndex(14, 15, 16)); segments.Add(new IfcLineIndex(16, 17)); segments.Add(new IfcArcIndex(17, 18, 19)); segments.Add(new IfcLineIndex(19, 20)); directrix = new IfcIndexedPolyCurve(new IfcCartesianPointList3D(db, points), segments); } double barDiameter = 12, area = Math.PI * Math.Pow(barDiameter, 2) / 4; IfcSweptDiskSolid sweptDiskSolid = new IfcSweptDiskSolid(directrix, barDiameter / 2.0); IfcRepresentationMap representationMap = new IfcRepresentationMap(sweptDiskSolid); string shapeCode = ""; //Todo IfcReinforcingBarType reinforcingBarType = new IfcReinforcingBarType(db, "12 Diameter Ligature", IfcReinforcingBarTypeEnum.LIGATURE, barDiameter, area, 1150, IfcReinforcingBarSurfaceEnum.TEXTURED, shapeCode, null) { GlobalId = "0jMRtfHYXE7u4s_CQ2uVE9", MaterialSelect = material }; reinforcingBarType.RepresentationMaps.Add(representationMap); db.Context.AddDeclared(reinforcingBarType); if (assembly) { IfcMaterial concrete = new IfcMaterial(db, "Concrete") { Category = "Concrete" }; string name = "400x200RC"; IfcRectangleProfileDef rectangleProfileDef = new IfcRectangleProfileDef(db, name, 200, 400); IfcMaterialProfile materialProfile = new IfcMaterialProfile(name, concrete, rectangleProfileDef); IfcBeamType beamType = new IfcBeamType(name, materialProfile, IfcBeamTypeEnum.BEAM); db.Context.AddDeclared(beamType); IfcMaterialProfileSet materialProfileSet = beamType.MaterialSelect as IfcMaterialProfileSet; IfcBeam beam = new IfcBeam(building, new IfcLocalPlacement(building.Placement, new IfcAxis2Placement3D(new IfcCartesianPoint(db, 0, 0, 0))), null) { Description = "Reinforced Beam" }; IfcBeamStandardCase beamStandardCase = new IfcBeamStandardCase(beam, new IfcMaterialProfileSetUsage(materialProfileSet, IfcCardinalPointReference.TOPMID), new IfcAxis2Placement3D(new IfcCartesianPoint(db, 0, 0, 0), new IfcDirection(db, 0, 1, 0), new IfcDirection(db, -1, 0, 0)), 5000) { GlobalId = "1yjQ2DwLnCC8k3i3X6D_ut", RelatingType = beamType }; IfcElementAssembly elementAssembly = new IfcElementAssembly(beam, IfcAssemblyPlaceEnum.FACTORY, IfcElementAssemblyTypeEnum.REINFORCEMENT_UNIT); List <string> ids = new List <string>() { "0ohBfsArr3ruXYxacT4yl5", "3YrK7RbE122fNRsP5djFAe", "0wxAc63nj5AezFhfks7wLL", "0bsov2wZL6tRRZmKy4vuUU", "3qrgfIBb92ZegJTle7jou3", "16m6R3JeT83fJPCze2yU$a", "2SGIIYjSbCuu3HVwoLt1yh", "0PsLby6eL8_hVEt4QwK0lZ", "1325VJou5AngWp1djcV0hL", "20zj_$BcH74xRgR4bDrLNb", "3M4SfEMtHEJukgZR4hw$eV", "23BYnIaOLBZPVTrKVEDJiy", "2XulRByDL8ugyo4Uqv9rJr", "2xvQMSga96XOT3VeCS6ZsK", "2gUE6_w3j77f8YJGz_2RMl", "0J0dRL4tT93REAabfASDom", "048RJ151b81PqODsTMD4EA", "3hXx9Kb6b5bvjgr9pwvpz0", "0FmUHg8ZX0ZfY$0f5nkM2l", "2_zvpwRdvAuRiTlHXX$Qp8", "1mhkXHKfX6PxdS2vZn17wX", "0CeIQzUqP5qOOeAjMtH2OX", "3shtoAQL5BAhvwA_1Ph$lC", "22j4RNKqD2IBRDGig5eaCF", "3Wvu6qGJH4ChhTV3pl9CGh", "37Qrf07Iz3tRMbSxEA4ynH", "2gelqZ1Wv8BvCy6TstVGkd", "1Q21dHc_X7eRppCHrT69Vb", "0e6Wc08NLD59ueqCAK1gxp", "3xdMOSZMj3cBOV_QTbXZha", "1r_U9JTkHDWwkv_nfWFHVe", "29I7_S2fT3WRD4zPH4YjmD", "0$ciATTaP17PJMHQD0$N3Y", "1irBeCCUf82wdGg7qTPCbW" }; int jcounter = 0; for (int icounter = 25; icounter < 5000; icounter += 150) { IfcElement element = reinforcingBarType.GenerateMappedItemElement(elementAssembly, new IfcCartesianTransformationOperator3D(db) { LocalOrigin = new IfcCartesianPoint(db, 0, icounter, 0) }); //Unique ids assigned to generate constant IfcScript sample files, remove otherwise element.GlobalId = ids[jcounter++]; } //Unique ids assigned to generate constant IfcScript sample files, remove otherwise beam.GlobalId = "1_KSmTR8T8bO37iRs24GkM"; beamType.GlobalId = "3bdpqVuWTCbxJ2S3ODYv6q"; beamType.ObjectTypeOf.GlobalId = "2oaQVVf79BrwRouvtRuQVg"; beamType.MaterialSelect.Associates.GlobalId = "2ZEgyI2v184hwa$_diRqS9"; beamStandardCase.MaterialSelect.Associates.GlobalId = "3DWeleqqjEG9KshbOZXUdY"; elementAssembly.GlobalId = "0Q1tCJWdj4kOkZUg7rkf2h"; elementAssembly.IsDecomposedBy[0].GlobalId = "1WdB196Kb72f_pKgj5rklU"; beam.IsDecomposedBy[0].GlobalId = "1b1SnKocD0WRevlg8Aqhj5"; } else { IfcElement element = reinforcingBarType.GenerateMappedItemElement(building, new IfcCartesianTransformationOperator3D(db)); //Unique ids assigned to generate constant IfcScript sample files, remove otherwise element.GlobalId = "0WUveBtSTDbunNjDLsuRn$"; } //Unique ids assigned to generate constant IfcScript sample files, remove otherwise reinforcingBarType.ObjectTypeOf.GlobalId = "1iAfl2ERbFmwi7uniy1H7j"; reinforcingBarType.MaterialSelect.Associates.GlobalId = "3gfVO40P5EfQyKZ_bF0R$6"; }
private static StructuralFramingType ToStructuralFramingType(this IfcBeamType beamType) { throw new NotImplementedException(); }
private static IfcBeam CreatePurlin(XbimModel model, HndzPurlin genericProducthndz) { using (XbimReadWriteTransaction txn = model.BeginTransaction("Create Purlin")) { IfcBeam beam = model.Instances.New <IfcBeam>(); IfcExtrudedAreaSolid body = model.Instances.New <IfcExtrudedAreaSolid>(); body.Depth = genericProducthndz.ExtrusionLine.RhinoLine.Length; IfcBeamType elementType = model.Instances.New <IfcBeamType>(); elementType.PredefinedType = IfcBeamTypeEnum.USERDEFINED; IfcMaterial material = model.Instances.New <IfcMaterial>(); material.Name = "STEEL"; beam.SetMaterial(material); IfcCartesianPoint insertPoint = model.Instances.New <IfcCartesianPoint>(); insertPoint.SetXY(genericProducthndz.ExtrusionLine.baseNode.Point.X, genericProducthndz.ExtrusionLine.baseNode.Point.Y); //insert at arbitrary position//****************Need Revision if (genericProducthndz.Profile is HndzRectangularProfile) { HndzRectangularProfile recProfile = genericProducthndz.Profile as HndzRectangularProfile; #region Type & Material &Tags string typeText = "HANDAZ-Column-Rectangular " + (int)recProfile.Rectangle.Width + " x " + (int)recProfile.Rectangle.Height + " mm"; elementType.Tag = typeText; elementType.Name = typeText; IfcLabel columnLabel = new IfcLabel(typeText); elementType.ElementType = columnLabel; elementType.ApplicableOccurrence = columnLabel; beam.Tag = typeText; beam.Name = typeText; beam.Description = typeText; beam.SetDefiningType(elementType, model); #endregion //represent column as a rectangular profile IfcRectangleProfileDef MyPurlinPofile = model.Instances.New <IfcRectangleProfileDef>(); MyPurlinPofile.ProfileType = IfcProfileTypeEnum.AREA; MyPurlinPofile.XDim = recProfile.Rectangle.Height; MyPurlinPofile.YDim = recProfile.Rectangle.Width; MyPurlinPofile.Position = model.Instances.New <IfcAxis2Placement2D>(); MyPurlinPofile.Position.RefDirection = model.Instances.New <IfcDirection>(); MyPurlinPofile.Position.RefDirection.SetXY(recProfile.OrientationInPlane.X, recProfile.OrientationInPlane.Y); //MyColumnPofile.Position.Location = insertPoint; //model as a swept area solid body.SweptArea = MyPurlinPofile; } if (genericProducthndz.Profile is HndzISectionProfile) { HndzISectionProfile Iprofile = genericProducthndz.Profile as HndzISectionProfile; #region Type & Material &Tags string typeText = "HANDAZ-Purlin-I beam (flange " + Iprofile.I_Section.b_f + " x " + Iprofile.I_Section.t_fTop + " and web " + Iprofile.I_Section.d + " x " + Iprofile.I_Section.t_w + " mm"; elementType.Tag = typeText; elementType.Name = typeText; IfcLabel columnLabel = new IfcLabel(typeText); elementType.ElementType = columnLabel; elementType.ApplicableOccurrence = columnLabel; beam.Tag = typeText; beam.Name = typeText; beam.Description = typeText; beam.SetDefiningType(elementType, model); #endregion // IfcPolyline pl = model.Instances.New<IfcPolyline>(); //List<Point3d> tempPoints= Iprofile.ConvertItoPoints(); // foreach (Point3d point in tempPoints) // { // IfcCartesianPoint tempPoint = model.Instances.New<IfcCartesianPoint>(); // tempPoint.SetXYZ(point.X, point.Y, point.Z); // pl.Points.Add(tempPoint); // } IfcIShapeProfileDef MyPurlinPofile = model.Instances.New <IfcIShapeProfileDef>(); MyPurlinPofile.FlangeThickness = Iprofile.I_Section.tf; MyPurlinPofile.WebThickness = Iprofile.I_Section.t_w; MyPurlinPofile.OverallWidth = Iprofile.I_Section.b_f; MyPurlinPofile.OverallDepth = Iprofile.I_Section.d; MyPurlinPofile.FilletRadius = 10; MyPurlinPofile.Position = model.Instances.New <IfcAxis2Placement2D>(); MyPurlinPofile.Position.RefDirection = model.Instances.New <IfcDirection>(); MyPurlinPofile.Position.RefDirection.SetXY(Iprofile.OrientationInPlane.X, Iprofile.OrientationInPlane.Y); //MyColumnPofile.Position.Location = insertPoint; //model as a swept area solid body.SweptArea = MyPurlinPofile; } if (genericProducthndz.Profile is HndzCSectionProfile) { HndzCSectionProfile Cprofile = genericProducthndz.Profile as HndzCSectionProfile; #region Type & Material &Tags string typeText = "HANDAZ-Purlin-C-Chanel (flange " + Cprofile.C_Section.b_f + " x " + Cprofile.C_Section.t_f + " and web " + Cprofile.C_Section.d + " x " + Cprofile.C_Section.t_w + " mm"; elementType.Tag = typeText; elementType.Name = typeText; IfcLabel columnLabel = new IfcLabel(typeText); elementType.ElementType = columnLabel; elementType.ApplicableOccurrence = columnLabel; beam.Tag = typeText; beam.Name = typeText; beam.Description = typeText; beam.SetDefiningType(elementType, model); #endregion IfcCShapeProfileDef MyPurlinPofile = model.Instances.New <IfcCShapeProfileDef>(); MyPurlinPofile.WallThickness = Cprofile.C_Section.t_f; //MyColumnPofile.WebThickness = Iprofile.C_Section.t_w; //ToDo:purlin web and flange thickness are the same!!!! MyPurlinPofile.Width = Cprofile.C_Section.b_f; MyPurlinPofile.Depth = Cprofile.C_Section.d; MyPurlinPofile.InternalFilletRadius = 10; MyPurlinPofile.Position = model.Instances.New <IfcAxis2Placement2D>(); MyPurlinPofile.Position.RefDirection = model.Instances.New <IfcDirection>(); MyPurlinPofile.Position.RefDirection.SetXY(Cprofile.OrientationInPlane.X, Cprofile.OrientationInPlane.Y); //model as a swept area solid body.SweptArea = MyPurlinPofile; } body.ExtrudedDirection = model.Instances.New <IfcDirection>(); body.ExtrudedDirection.SetXYZ(0, 0, 1); //body.ExtrudedDirection.SetXYZ(Hndzcol.ExtrusionLine.RhinoLine.Direction.X, Hndzcol.ExtrusionLine.RhinoLine.Direction.Y, Hndzcol.ExtrusionLine.RhinoLine.Direction.Z); //parameters to insert the geometry in the model IfcCartesianPoint origin = model.Instances.New <IfcCartesianPoint>(); origin.SetXYZ(genericProducthndz.ExtrusionLine.baseNode.Point.X, genericProducthndz.ExtrusionLine.baseNode.Point.Y, genericProducthndz.ExtrusionLine.baseNode.Point.Z); body.Position = model.Instances.New <IfcAxis2Placement3D>(); //body.Position.Location = origin; body.Position.RefDirection = model.Instances.New <IfcDirection>(); body.Position.RefDirection.SetXYZ(1, 0, 0); //Create a Definition shape to hold the geometry IfcShapeRepresentation shape = model.Instances.New <IfcShapeRepresentation>(); shape.ContextOfItems = model.IfcProject.ModelContext(); shape.RepresentationType = "SweptSolid"; shape.RepresentationIdentifier = "Body"; shape.Items.Add(body); //Create a Product Definition and add the model geometry to the column IfcProductDefinitionShape rep = model.Instances.New <IfcProductDefinitionShape>(); rep.Representations.Add(shape); beam.Representation = rep; //now place the column into the model IfcLocalPlacement lp = model.Instances.New <IfcLocalPlacement>(); IfcAxis2Placement3D ax3d = model.Instances.New <IfcAxis2Placement3D>(); ax3d.Location = origin; Vector3d perpendicularVector = new Vector3d(genericProducthndz.Profile.OrientationInPlane.X, genericProducthndz.Profile.OrientationInPlane.Y, 0); Plane extrusionPlane; bool aa = genericProducthndz.ExtrusionLine.RhinoLine.TryGetPlane(out extrusionPlane); if (aa) { perpendicularVector = extrusionPlane.ZAxis; } ax3d.RefDirection = model.Instances.New <IfcDirection>(); ax3d.RefDirection.SetXYZ(perpendicularVector.X, perpendicularVector.Y, perpendicularVector.Z); ax3d.Axis = model.Instances.New <IfcDirection>(); ax3d.Axis.SetXYZ(genericProducthndz.ExtrusionLine.RhinoLine.Direction.X, genericProducthndz.ExtrusionLine.RhinoLine.Direction.Y, genericProducthndz.ExtrusionLine.RhinoLine.Direction.Z); lp.RelativePlacement = ax3d; beam.ObjectPlacement = lp; #region Owner Data beam.OwnerHistory.OwningUser = model.DefaultOwningUser; beam.OwnerHistory.OwningApplication = model.DefaultOwningApplication; #endregion //validate write any errors to the console and commit if OK, otherwise abort string temp = Path.GetTempPath(); //if (model.Validate(txn.Modified(), File.CreateText("E:\\Column" + column.GlobalId + "Errors.txt")) == 0) // if (model.Validate(txn.Modified(), File.CreateText(temp + "Column" + column.GlobalId + "Errors.txt")) == 0) if (model.Validate(txn.Modified(), Console.Out) == 0) { txn.Commit(); return(beam); } return(null); } }
internal static void GenerateData(STPModelData md, IfcBuilding building, bool assembly) { IfcDocumentReference documentReference = new IfcDocumentReference(md, "", "MyReinforcementCode", "MyCodeISO3766", "", null); IfcRelAssociatesDocument associatesDocument = new IfcRelAssociatesDocument(md.Project, documentReference); associatesDocument.GlobalId = "1R7R97$uLAAv4wci$KGwn8"; IfcMaterial material = new IfcMaterial(md, "ReinforcingSteel", "", ""); List <Point3d> points = new List <Point3d>() { new Point3d(-69.0, 0.0, -122.0), new Point3d(-69.0, 0.0, -79.0), new Point3d(-54.9411254969541, 0.0, -45.0588745030455), new Point3d(-21.0, 0.0, -31.0), new Point3d(21.0, 0.0, -31.0), new Point3d(54.9411254969541, 0.0, -45.0588745030455), new Point3d(69.0, 0.0, -78.9999999999999), new Point3d(69.0, 0.00000000000000089, -321.0), new Point3d(54.9939785957165, 1.21791490472034, -354.941125496954), new Point3d(21.1804517666074, 4.15822158551252, -369.0), new Point3d(-20.6616529376114, 7.79666547283599, -369.0), new Point3d(-54.4751797667207, 10.7369721536282, -354.941125496954), new Point3d(-68.4812011710042, 11.9548870583485, -321.0), new Point3d(-69.0, 12.0, -79.0), new Point3d(-54.9411254969541, 12.0, -45.0588745030455), new Point3d(-21.0, 12.0, -31.0), new Point3d(21.0, 12.0, -31.0), new Point3d(54.9411254969541, 12.0, -45.0588745030455), new Point3d(69.0, 12.0, -78.9999999999999), new Point3d(69.0, 12.0, -122.0), }; PolyCurve pc = new PolyCurve(); pc.Append(new Line(points[0], points[1])); pc.Append(new Arc(points[1], points[2], points[3])); pc.Append(new Line(points[3], points[4])); pc.Append(new Arc(points[4], points[5], points[6])); pc.Append(new Line(points[6], points[7])); pc.Append(new Arc(points[7], points[8], points[9])); pc.Append(new Line(points[9], points[10])); pc.Append(new Arc(points[10], points[11], points[12])); pc.Append(new Line(points[12], points[13])); pc.Append(new Arc(points[13], points[14], points[15])); pc.Append(new Line(points[15], points[16])); pc.Append(new Arc(points[16], points[17], points[18])); pc.Append(new Line(points[18], points[19])); IfcBoundedCurve directrix = IfcBoundedCurve.ConvertCurve(md, pc); double barDiameter = 12, area = Math.PI * Math.Pow(barDiameter, 2) / 4; IfcSweptDiskSolid sweptDiskSolid = new IfcSweptDiskSolid(directrix, barDiameter / 2.0, 0); IfcRepresentationMap representationMap = new IfcRepresentationMap(sweptDiskSolid); string shapeCode = ""; //Todo IfcReinforcingBarType reinforcingBarType = new IfcReinforcingBarType(md, new IfcElemTypeParams("0jMRtfHYXE7u4s_CQ2uVE9", "12 Diameter Ligature", "", "", ""), material, representationMap, null, IfcReinforcingBarTypeEnum.LIGATURE, barDiameter, area, 1150, IfcReinforcingBarSurfaceEnum.TEXTURED, shapeCode, null); reinforcingBarType.ObjectTypeOf.GlobalId = "1iAfl2ERbFmwi7uniy1H7j"; reinforcingBarType.Material.Associates.GlobalId = "3gfVO40P5EfQyKZ_bF0R$6"; if (assembly) { IfcMaterial concrete = new IfcMaterial(md, "Concrete", "", "Concrete"); string name = "400x200RC"; IfcRectangleProfileDef rectangleProfileDef = new IfcRectangleProfileDef(md, IfcProfileTypeEnum.AREA, name, null, 400, 200); IfcMaterialProfile materialProfile = new IfcMaterialProfile(md, name, "", concrete, rectangleProfileDef, 0, ""); IfcBeamType beamType = new IfcBeamType(md, new IfcElemTypeParams("3bdpqVuWTCbxJ2S3ODYv6q", name, "", "", ""), materialProfile, null, IfcBeamTypeEnum.BEAM); beamType.ObjectTypeOf.GlobalId = "2oaQVVf79BrwRouvtRuQVg"; beamType.Material.Associates.GlobalId = "2ZEgyI2v184hwa$_diRqS9"; IfcBeamStandardCase beamStandardCase = new IfcBeamStandardCase(building, new IfcElemParams("1yjQ2DwLnCC8k3i3X6D_ut", "", "", "", ""), beamType, new Line(0, 0, 0, 0, 5000, 0), Vector3d.ZAxis, IfcCardinalPointReference.TOPMID, null); beamStandardCase.Material.Associates.GlobalId = "3DWeleqqjEG9KshbOZXUdY"; IfcElementAssembly elementAssembly = new IfcElementAssembly(beamStandardCase, new IfcElemParams("0Q1tCJWdj4kOkZUg7rkf2h", "", "", "", ""), IfcAssemblyPlaceEnum.FACTORY, IfcElementAssemblyTypeEnum.REINFORCEMENT_UNIT); List <string> ids = new List <string>() { "0ohBfsArr3ruXYxacT4yl5", "3YrK7RbE122fNRsP5djFAe", "0wxAc63nj5AezFhfks7wLL", "0bsov2wZL6tRRZmKy4vuUU", "3qrgfIBb92ZegJTle7jou3", "16m6R3JeT83fJPCze2yU$a", "2SGIIYjSbCuu3HVwoLt1yh", "0PsLby6eL8_hVEt4QwK0lZ", "1325VJou5AngWp1djcV0hL", "20zj_$BcH74xRgR4bDrLNb", "3M4SfEMtHEJukgZR4hw$eV", "23BYnIaOLBZPVTrKVEDJiy", "2XulRByDL8ugyo4Uqv9rJr", "2xvQMSga96XOT3VeCS6ZsK", "2gUE6_w3j77f8YJGz_2RMl", "0J0dRL4tT93REAabfASDom", "048RJ151b81PqODsTMD4EA", "3hXx9Kb6b5bvjgr9pwvpz0", "0FmUHg8ZX0ZfY$0f5nkM2l", "2_zvpwRdvAuRiTlHXX$Qp8", "1mhkXHKfX6PxdS2vZn17wX", "0CeIQzUqP5qOOeAjMtH2OX", "3shtoAQL5BAhvwA_1Ph$lC", "22j4RNKqD2IBRDGig5eaCF", "3Wvu6qGJH4ChhTV3pl9CGh", "37Qrf07Iz3tRMbSxEA4ynH", "2gelqZ1Wv8BvCy6TstVGkd", "1Q21dHc_X7eRppCHrT69Vb", "0e6Wc08NLD59ueqCAK1gxp", "3xdMOSZMj3cBOV_QTbXZha", "1r_U9JTkHDWwkv_nfWFHVe", "29I7_S2fT3WRD4zPH4YjmD", "0$ciATTaP17PJMHQD0$N3Y", "1irBeCCUf82wdGg7qTPCbW" }; int jcounter = 0; for (int icounter = 25; icounter < 5000; icounter += 150) { IfcElemParams ep = new IfcElemParams(ids[jcounter++], "", "", "", ""); reinforcingBarType.GenerateMappedItemElement(elementAssembly, new Plane(new Point3d(0, icounter, 0), Vector3d.XAxis, Vector3d.YAxis), ep); } elementAssembly.IsDecomposedBy[0].GlobalId = "1WdB196Kb72f_pKgj5rklU"; } else { reinforcingBarType.GenerateMappedItemElement(building, Plane.WorldXY, new IfcElemParams("0WUveBtSTDbunNjDLsuRn$", "", "", "", "")); } }