private IfcBeam GenerateIPE200(DatabaseIfc db, IfcBuilding building, bool tessellated) { if (tessellated) { List <Tuple <double, double, double> > coords = new List <Tuple <double, double, double> >() { new Tuple <double, double, double>(1000.0, 50.0, -91.5), new Tuple <double, double, double>(1000.0, 14.8, -91.5), new Tuple <double, double, double>(1000.0, 50.0, -100.0), new Tuple <double, double, double>(1000.0, -50.0, -100.0), new Tuple <double, double, double>(1000.0, -50.0, -91.5), new Tuple <double, double, double>(1000.0, -14.8, -91.5), new Tuple <double, double, double>(1000.0, -2.8, 79.5), new Tuple <double, double, double>(1000.0, -2.8, -79.5), new Tuple <double, double, double>(1000.0, -50.0, 91.5), new Tuple <double, double, double>(1000.0, -14.8, 91.5), new Tuple <double, double, double>(1000.0, -50.0, 100.0), new Tuple <double, double, double>(1000.0, 50.0, 100.0), new Tuple <double, double, double>(1000.0, 50.0, 91.5), new Tuple <double, double, double>(1000.0, 14.8, 91.5), new Tuple <double, double, double>(1000.0, 2.8, -79.5), new Tuple <double, double, double>(1000.0, 2.8, 79.5), new Tuple <double, double, double>(0.0, 2.8, 79.5), new Tuple <double, double, double>(0.0, 2.8, -79.5), new Tuple <double, double, double>(0.0, 50.0, 91.5), new Tuple <double, double, double>(0.0, 14.8, 91.5), new Tuple <double, double, double>(0.0, 50.0, 100.0), new Tuple <double, double, double>(0.0, -50.0, 100.0), new Tuple <double, double, double>(0.0, -50.0, 91.5), new Tuple <double, double, double>(0.0, -14.8, 91.5), new Tuple <double, double, double>(0.0, -2.8, -79.5), new Tuple <double, double, double>(0.0, -2.8, 79.5), new Tuple <double, double, double>(0.0, -50.0, -91.5), new Tuple <double, double, double>(0.0, -14.8, -91.5), new Tuple <double, double, double>(0.0, -50.0, -100.0), new Tuple <double, double, double>(0.0, 50.0, -100.0), new Tuple <double, double, double>(0.0, 50.0, -91.5), new Tuple <double, double, double>(0.0, 14.8, -91.5), new Tuple <double, double, double>(0.0, 14.8, -91.5), new Tuple <double, double, double>(0.0, 2.8, -79.5), new Tuple <double, double, double>(1000.0, 14.8, -91.5), new Tuple <double, double, double>(1000.0, 2.8, -79.5), new Tuple <double, double, double>(500.0, 2.8, -79.5), new Tuple <double, double, double>(500.0, 14.8, -91.5), new Tuple <double, double, double>(0.0, 2.8, -79.5), new Tuple <double, double, double>(0.0, 2.8, 79.5), new Tuple <double, double, double>(1000.0, 2.8, -79.5), new Tuple <double, double, double>(1000.0, 2.8, 79.5), new Tuple <double, double, double>(500.0, 2.8, -79.5), new Tuple <double, double, double>(500.0, 2.8, 79.5), new Tuple <double, double, double>(0.0, 2.8, 79.5), new Tuple <double, double, double>(0.0, 14.8, 91.5), new Tuple <double, double, double>(1000.0, 2.8, 79.5), new Tuple <double, double, double>(1000.0, 14.8, 91.5), new Tuple <double, double, double>(500.0, 2.8, 79.5), new Tuple <double, double, double>(500.0, 14.8, 91.5), new Tuple <double, double, double>(0.0, 14.8, 91.5), new Tuple <double, double, double>(0.0, 50.0, 91.5), new Tuple <double, double, double>(1000.0, 14.8, 91.5), new Tuple <double, double, double>(1000.0, 50.0, 91.5), new Tuple <double, double, double>(500.0, 14.8, 91.5), new Tuple <double, double, double>(500.0, 50.0, 91.5), new Tuple <double, double, double>(0.0, 50.0, 91.5), new Tuple <double, double, double>(0.0, 50.0, 100.0), new Tuple <double, double, double>(1000.0, 50.0, 91.5), new Tuple <double, double, double>(1000.0, 50.0, 100.0), new Tuple <double, double, double>(500.0, 50.0, 91.5), new Tuple <double, double, double>(500.0, 50.0, 100.0), new Tuple <double, double, double>(0.0, 50.0, 100.0), new Tuple <double, double, double>(0.0, -50.0, 100.0), new Tuple <double, double, double>(1000.0, 50.0, 100.0), new Tuple <double, double, double>(1000.0, -50.0, 100.0), new Tuple <double, double, double>(500.0, 50.0, 100.0), new Tuple <double, double, double>(500.0, -50.0, 100.0), new Tuple <double, double, double>(0.0, -50.0, 100.0), new Tuple <double, double, double>(0.0, -50.0, 91.5), new Tuple <double, double, double>(1000.0, -50.0, 100.0), new Tuple <double, double, double>(1000.0, -50.0, 91.5), new Tuple <double, double, double>(500.0, -50.0, 100.0), new Tuple <double, double, double>(500.0, -50.0, 91.5), new Tuple <double, double, double>(0.0, -50.0, 91.5), new Tuple <double, double, double>(0.0, -14.8, 91.5), new Tuple <double, double, double>(1000.0, -50.0, 91.5), new Tuple <double, double, double>(1000.0, -14.8, 91.5), new Tuple <double, double, double>(500.0, -50.0, 91.5), new Tuple <double, double, double>(500.0, -14.8, 91.5), new Tuple <double, double, double>(0.0, -14.8, 91.5), new Tuple <double, double, double>(0.0, -2.8, 79.5), new Tuple <double, double, double>(1000.0, -14.8, 91.5), new Tuple <double, double, double>(1000.0, -2.8, 79.5), new Tuple <double, double, double>(500.0, -14.8, 91.5), new Tuple <double, double, double>(500.0, -2.8, 79.5), new Tuple <double, double, double>(0.0, -2.8, 79.5), new Tuple <double, double, double>(0.0, -2.8, -79.5), new Tuple <double, double, double>(1000.0, -2.8, 79.5), new Tuple <double, double, double>(1000.0, -2.8, -79.5), new Tuple <double, double, double>(500.0, -2.8, 79.5), new Tuple <double, double, double>(500.0, -2.8, -79.5), new Tuple <double, double, double>(0.0, -2.8, -79.5), new Tuple <double, double, double>(0.0, -14.8, -91.5), new Tuple <double, double, double>(1000.0, -2.8, -79.5), new Tuple <double, double, double>(1000.0, -14.8, -91.5), new Tuple <double, double, double>(500.0, -2.8, -79.5), new Tuple <double, double, double>(500.0, -14.8, -91.5), new Tuple <double, double, double>(0.0, -14.8, -91.5), new Tuple <double, double, double>(0.0, -50.0, -91.5), new Tuple <double, double, double>(1000.0, -14.8, -91.5), new Tuple <double, double, double>(1000.0, -50.0, -91.5), new Tuple <double, double, double>(500.0, -14.8, -91.5), new Tuple <double, double, double>(500.0, -50.0, -91.5), new Tuple <double, double, double>(0.0, -50.0, -91.5), new Tuple <double, double, double>(0.0, -50.0, -100.0), new Tuple <double, double, double>(1000.0, -50.0, -91.5), new Tuple <double, double, double>(1000.0, -50.0, -100.0), new Tuple <double, double, double>(500.0, -50.0, -91.5), new Tuple <double, double, double>(500.0, -50.0, -100.0), new Tuple <double, double, double>(0.0, -50.0, -100.0), new Tuple <double, double, double>(0.0, 50.0, -100.0), new Tuple <double, double, double>(1000.0, -50.0, -100.0), new Tuple <double, double, double>(1000.0, 50.0, -100.0), new Tuple <double, double, double>(500.0, -50.0, -100.0), new Tuple <double, double, double>(500.0, 50.0, -100.0), new Tuple <double, double, double>(0.0, 50.0, -100.0), new Tuple <double, double, double>(0.0, 50.0, -91.5), new Tuple <double, double, double>(1000.0, 50.0, -100.0), new Tuple <double, double, double>(1000.0, 50.0, -91.5), new Tuple <double, double, double>(500.0, 50.0, -100.0), new Tuple <double, double, double>(500.0, 50.0, -91.5), new Tuple <double, double, double>(0.0, 50.0, -91.5), new Tuple <double, double, double>(0.0, 14.8, -91.5), new Tuple <double, double, double>(1000.0, 50.0, -91.5), new Tuple <double, double, double>(1000.0, 14.8, -91.5), new Tuple <double, double, double>(500.0, 50.0, -91.5), new Tuple <double, double, double>(500.0, 14.8, -91.5) }; IfcCartesianPointList3D cartesianPointList3D = new IfcCartesianPointList3D(db, coords); cartesianPointList3D.Comments.Add("the geometric representation of the beam is provided as a triangulated face set"); cartesianPointList3D.Comments.Add("the meshing depends on the creating software system"); List <CoordIndex> coordIndex = new List <CoordIndex>() { new CoordIndex(6, 5, 4), new CoordIndex(15, 8, 6), new CoordIndex(6, 4, 3), new CoordIndex(10, 11, 9), new CoordIndex(16, 10, 7), new CoordIndex(14, 11, 10), new CoordIndex(7, 8, 16), new CoordIndex(6, 2, 15), new CoordIndex(2, 3, 1), new CoordIndex(3, 2, 6), new CoordIndex(10, 16, 14), new CoordIndex(14, 13, 12), new CoordIndex(11, 14, 12), new CoordIndex(8, 15, 16), new CoordIndex(24, 23, 22), new CoordIndex(17, 26, 24), new CoordIndex(22, 21, 20), new CoordIndex(28, 29, 27), new CoordIndex(32, 28, 25), new CoordIndex(30, 29, 28), new CoordIndex(18, 25, 26), new CoordIndex(24, 20, 17), new CoordIndex(20, 21, 19), new CoordIndex(32, 31, 30), new CoordIndex(28, 32, 30), new CoordIndex(33, 34, 37), new CoordIndex(36, 35, 38), new CoordIndex(40, 44, 43), new CoordIndex(41, 43, 44), new CoordIndex(46, 50, 49), new CoordIndex(47, 49, 50), new CoordIndex(56, 55, 51), new CoordIndex(55, 56, 54), new CoordIndex(57, 58, 62), new CoordIndex(60, 59, 61), new CoordIndex(63, 64, 68), new CoordIndex(66, 65, 67), new CoordIndex(69, 70, 74), new CoordIndex(72, 71, 73), new CoordIndex(80, 79, 75), new CoordIndex(79, 80, 78), new CoordIndex(81, 82, 86), new CoordIndex(84, 83, 85), new CoordIndex(88, 92, 91), new CoordIndex(89, 91, 92), new CoordIndex(94, 98, 97), new CoordIndex(95, 97, 98), new CoordIndex(104, 103, 99), new CoordIndex(103, 104, 102), new CoordIndex(105, 106, 110), new CoordIndex(108, 107, 109), new CoordIndex(111, 112, 116), new CoordIndex(114, 113, 115), new CoordIndex(117, 118, 122), new CoordIndex(120, 119, 121), new CoordIndex(128, 127, 123), new CoordIndex(127, 128, 126), new CoordIndex(22, 20, 24), new CoordIndex(32, 25, 18), new CoordIndex(18, 26, 17), new CoordIndex(33, 37, 38), new CoordIndex(36, 38, 37), new CoordIndex(40, 43, 39), new CoordIndex(41, 44, 42), new CoordIndex(46, 49, 45), new CoordIndex(47, 50, 48), new CoordIndex(56, 51, 52), new CoordIndex(55, 54, 53), new CoordIndex(57, 62, 61), new CoordIndex(60, 61, 62), new CoordIndex(63, 68, 67), new CoordIndex(66, 67, 68), new CoordIndex(69, 74, 73), new CoordIndex(72, 73, 74), new CoordIndex(80, 75, 76), new CoordIndex(79, 78, 77), new CoordIndex(81, 86, 85), new CoordIndex(84, 85, 86), new CoordIndex(88, 91, 87), new CoordIndex(89, 92, 90), new CoordIndex(94, 97, 93), new CoordIndex(95, 98, 96), new CoordIndex(104, 99, 100), new CoordIndex(103, 102, 101), new CoordIndex(105, 110, 109), new CoordIndex(108, 109, 110), new CoordIndex(111, 116, 115), new CoordIndex(114, 115, 116), new CoordIndex(117, 122, 121), new CoordIndex(120, 121, 122), new CoordIndex(128, 123, 124), new CoordIndex(127, 126, 125) }; IfcTriangulatedFaceSet triangulatedFaceSet = new IfcTriangulatedFaceSet(cartesianPointList3D, true, coordIndex); return(new IfcBeam(building, null, new IfcProductDefinitionShape(new IfcShapeRepresentation(triangulatedFaceSet))) { GlobalId = "0EF5_zZRv0pQPddeofU3KT", Name = "ExampleBeamName", Description = "ExampleBeamDescription", Tag = "Tag" }); } List <Coord2d> points = new List <Coord2d>() { new Coord2d(2.8, -79.5), new Coord2d(2.8, 79.5), new Coord2d(6.314719, 87.985281), new Coord2d(14.8, 91.5), new Coord2d(50.0, 91.5), new Coord2d(50.0, 100.0), new Coord2d(-50.0, 100.0), new Coord2d(-50.0, 91.5), new Coord2d(-14.8, 91.5), new Coord2d(-6.314719, 87.985281), new Coord2d(-2.8, 79.5), new Coord2d(-2.8, -79.5), new Coord2d(-6.314719, -87.985281), new Coord2d(-14.8, -91.5), new Coord2d(-50.0, -91.5), new Coord2d(-50.0, -100.0), new Coord2d(50.0, -100.0), new Coord2d(50.0, -91.5), new Coord2d(14.8, -91.5), new Coord2d(6.314719, -87.985281) }; 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 IfcLineIndex(5, 6)); segments.Add(new IfcLineIndex(6, 7)); segments.Add(new IfcLineIndex(7, 8)); segments.Add(new IfcLineIndex(8, 9)); segments.Add(new IfcArcIndex(9, 10, 11)); segments.Add(new IfcLineIndex(11, 12)); segments.Add(new IfcArcIndex(12, 13, 14)); segments.Add(new IfcLineIndex(14, 15)); segments.Add(new IfcLineIndex(15, 16)); segments.Add(new IfcLineIndex(16, 17)); segments.Add(new IfcLineIndex(17, 18)); segments.Add(new IfcLineIndex(18, 19)); segments.Add(new IfcArcIndex(19, 20, 1)); IfcBoundedCurve boundedCurve = IfcBoundedCurve.Generate(db, points, segments); IfcArbitraryClosedProfileDef arbitraryClosedProfileDef = new IfcArbitraryClosedProfileDef("IPE200", boundedCurve); IfcAxis2Placement3D axis2Placement3D = new IfcAxis2Placement3D(new IfcCartesianPoint(db, 0, 0, 0), new IfcDirection(db, 0, 1, 0), new IfcDirection(db, 1, 0, 0)); IfcExtrudedAreaSolid extrudedAreaSolid = new IfcExtrudedAreaSolid(arbitraryClosedProfileDef, axis2Placement3D, new IfcDirection(db, 0, 0, 1), 1000); IfcBeam beam = new IfcBeam(building, null, new IfcProductDefinitionShape(new IfcShapeRepresentation(extrudedAreaSolid))) { Name = "ExampleBeamName", Description = "ExampleBeamDescription", Tag = "Tag" }; //Unique ids assigned to generate constant IfcScript sample files, remove otherwise beam.GlobalId = "0EF5_zZRv0pQPddeofU3KT"; return(beam); }
internal static Beam ToBeam(this IfcBeam beam) { var elementTransform = beam.ObjectPlacement.ToTransform(); var solid = beam.RepresentationsOfType <IfcExtrudedAreaSolid>().FirstOrDefault(); // foreach (var cis in beam.ContainedInStructure) // { // cis.RelatingStructure.ObjectPlacement.ToTransform().Concatenate(transform); // } if (solid != null) { var solidTransform = solid.Position.ToTransform(); var c = solid.SweptArea.ToCurve(); if (c is Polygon) { var cl = new Line(Vector3.Origin, solid.ExtrudedDirection.ToVector3(), (IfcLengthMeasure)solid.Depth); var result = new Beam(solidTransform.OfLine(cl), new Profile((Polygon)c), BuiltInMaterials.Steel, 0.0, 0.0, 0.0, elementTransform, false, IfcGuid.FromIfcGUID(beam.GlobalId), beam.Name); return(result); } } return(null); }
private static IfcBeam ToIfc(this Beam beam, IfcLocalPlacement localPlacement, IfcProductDefinitionShape shape) { var ifcBeam = new IfcBeam(IfcGuid.ToIfcGuid(beam.Id), null, null, null, null, localPlacement, shape, null, IfcBeamTypeEnum.BEAM); return(ifcBeam); }
private static IfcBeam ToIfc(this Beam beam, IfcLocalPlacement localPlacement, IfcProductDefinitionShape shape) { var ifcBeam = new IfcBeam(IfcGuid.ToIfcGuid(Guid.NewGuid()), null, null, null, null, localPlacement, shape, null); return(ifcBeam); }
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); } }
internal static IfcBeam createBeam(IfcProduct host, IfcProfileDef profile, IfcCartesianPoint cartesianPoint, string globalId) { DatabaseIfc db = host.Database; IfcAxis2Placement3D position = new IfcAxis2Placement3D(db.Factory.Origin, db.Factory.XAxis, db.Factory.YAxisNegative); IfcExtrudedAreaSolid extrudedAreaSolid = new IfcExtrudedAreaSolid(profile, position, 5000); IfcShapeRepresentation shapeRepresentation = new IfcShapeRepresentation(extrudedAreaSolid); IfcProductDefinitionShape productDefinitionShape = new IfcProductDefinitionShape(shapeRepresentation); IfcLocalPlacement localPlacement = createLocalPlacement(host, cartesianPoint, db.Factory.YAxis); IfcBeam beam = new IfcBeam(host, localPlacement, productDefinitionShape); setGlobalId(beam, globalId); return(beam); }
private static IfcBeam ToIfcBeam(this Beam beam, IfcRepresentationContext context, Document doc) { var sweptArea = beam.ElementType.Profile.Perimeter.ToIfcArbitraryClosedProfileDef(doc); var line = beam.Curve as Line; if (line == null) { throw new Exception("The beam could not be exported to IFC. Only linear beams are currently supported."); } // We use the Z extrude direction because the direction is // relative to the local placement, which is a transform at the // beam's end with the Z axis pointing along the direction. var extrudeDirection = Vector3.ZAxis.ToIfcDirection(); var position = new Transform().ToIfcAxis2Placement3D(doc); var repItem = new IfcExtrudedAreaSolid(sweptArea, position, extrudeDirection, new IfcPositiveLengthMeasure(beam.Curve.Length())); var localPlacement = beam.Curve.TransformAt(0.0).ToIfcLocalPlacement(doc); var rep = new IfcShapeRepresentation(context, "Body", "SweptSolid", new List <IfcRepresentationItem> { repItem }); var productRep = new IfcProductDefinitionShape(new List <IfcRepresentation> { rep }); var ifcBeam = new IfcBeam(IfcGuid.ToIfcGuid(Guid.NewGuid()), null, null, null, null, localPlacement, productRep, null); doc.AddEntity(sweptArea); doc.AddEntity(extrudeDirection); doc.AddEntity(position); doc.AddEntity(repItem); doc.AddEntity(rep); doc.AddEntity(localPlacement); doc.AddEntity(productRep); doc.AddEntity(ifcBeam); return(ifcBeam); }
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); }
protected void GenerateInstance(IfcBuilding building, bool tessellated) { IfcBeam beam = GenerateIPE200(building, tessellated); }
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"; }
protected void GenerateData(STPModelData md, IfcBuilding building, bool tessellated) { IfcBeam beam = GenerateIPE200(md, building, tessellated); }
internal XbimBeam(XbimDocument document, IfcBeam beam) : base(document) { _ifcBuildingElement = beam; }
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); } }
protected void GenerateData(DatabaseIfc db, IfcBuilding building, bool tessellated) { IfcBeam beam = GenerateIPE200(db, building, tessellated); }