From cafc792276b791e962025a08c6e1c1328d5bc74e Mon Sep 17 00:00:00 2001 From: Peter Morton Date: Mon, 12 Oct 2020 21:19:20 +0100 Subject: [PATCH] Modified beam wall and column examples for use with latest version of GeometryGymIFC. --- IfcScript/Examples/Beam.cs | 6 +++--- IfcScript/Examples/Column.cs | 5 ++--- IfcScript/Examples/Wall.cs | 2 -- IfcScript/IFCExampleBase.cs | 14 +++++--------- IfcScript/IfcScript.csproj | 14 +++----------- IfcScript/app.config | 13 +++++++++++-- IfcScript/packages.config | 2 +- 7 files changed, 25 insertions(+), 31 deletions(-) diff --git a/IfcScript/Examples/Beam.cs b/IfcScript/Examples/Beam.cs index b068516..3d8970d 100644 --- a/IfcScript/Examples/Beam.cs +++ b/IfcScript/Examples/Beam.cs @@ -52,11 +52,11 @@ private IfcBeam GenerateIPE200(IfcBuilding building, bool tessellated) { List> coords = new List>() { new Tuple(1000.0, 50.0, -91.5), new Tuple(1000.0, 14.8, -91.5), new Tuple(1000.0, 50.0, -100.0), new Tuple(1000.0, -50.0, -100.0), new Tuple(1000.0, -50.0, -91.5), new Tuple(1000.0, -14.8, -91.5), new Tuple(1000.0, -2.8, 79.5), new Tuple(1000.0, -2.8, -79.5), new Tuple(1000.0, -50.0, 91.5), new Tuple(1000.0, -14.8, 91.5), new Tuple(1000.0, -50.0, 100.0), new Tuple(1000.0, 50.0, 100.0), new Tuple(1000.0, 50.0, 91.5), new Tuple(1000.0, 14.8, 91.5), new Tuple(1000.0, 2.8, -79.5), new Tuple(1000.0, 2.8, 79.5), new Tuple(0.0, 2.8, 79.5), new Tuple(0.0, 2.8, -79.5), new Tuple(0.0, 50.0, 91.5), new Tuple(0.0, 14.8, 91.5), new Tuple(0.0, 50.0, 100.0), new Tuple(0.0, -50.0, 100.0), new Tuple(0.0, -50.0, 91.5), new Tuple(0.0, -14.8, 91.5), new Tuple(0.0, -2.8, -79.5), new Tuple(0.0, -2.8, 79.5), new Tuple(0.0, -50.0, -91.5), new Tuple(0.0, -14.8, -91.5), new Tuple(0.0, -50.0, -100.0), new Tuple(0.0, 50.0, -100.0), new Tuple(0.0, 50.0, -91.5), new Tuple(0.0, 14.8, -91.5), new Tuple(0.0, 14.8, -91.5), new Tuple(0.0, 2.8, -79.5), new Tuple(1000.0, 14.8, -91.5), new Tuple(1000.0, 2.8, -79.5), new Tuple(500.0, 2.8, -79.5), new Tuple(500.0, 14.8, -91.5), new Tuple(0.0, 2.8, -79.5), new Tuple(0.0, 2.8, 79.5), new Tuple(1000.0, 2.8, -79.5), new Tuple(1000.0, 2.8, 79.5), new Tuple(500.0, 2.8, -79.5), new Tuple(500.0, 2.8, 79.5), new Tuple(0.0, 2.8, 79.5), new Tuple(0.0, 14.8, 91.5), new Tuple(1000.0, 2.8, 79.5), new Tuple(1000.0, 14.8, 91.5), new Tuple(500.0, 2.8, 79.5), new Tuple(500.0, 14.8, 91.5), new Tuple(0.0, 14.8, 91.5), new Tuple(0.0, 50.0, 91.5), new Tuple(1000.0, 14.8, 91.5), new Tuple(1000.0, 50.0, 91.5), new Tuple(500.0, 14.8, 91.5), new Tuple(500.0, 50.0, 91.5), new Tuple(0.0, 50.0, 91.5), new Tuple(0.0, 50.0, 100.0), new Tuple(1000.0, 50.0, 91.5), new Tuple(1000.0, 50.0, 100.0), new Tuple(500.0, 50.0, 91.5), new Tuple(500.0, 50.0, 100.0), new Tuple(0.0, 50.0, 100.0), new Tuple(0.0, -50.0, 100.0), new Tuple(1000.0, 50.0, 100.0), new Tuple(1000.0, -50.0, 100.0), new Tuple(500.0, 50.0, 100.0), new Tuple(500.0, -50.0, 100.0), new Tuple(0.0, -50.0, 100.0), new Tuple(0.0, -50.0, 91.5), new Tuple(1000.0, -50.0, 100.0), new Tuple(1000.0, -50.0, 91.5), new Tuple(500.0, -50.0, 100.0), new Tuple(500.0, -50.0, 91.5), new Tuple(0.0, -50.0, 91.5), new Tuple(0.0, -14.8, 91.5), new Tuple(1000.0, -50.0, 91.5), new Tuple(1000.0, -14.8, 91.5), new Tuple(500.0, -50.0, 91.5), new Tuple(500.0, -14.8, 91.5), new Tuple(0.0, -14.8, 91.5), new Tuple(0.0, -2.8, 79.5), new Tuple(1000.0, -14.8, 91.5), new Tuple(1000.0, -2.8, 79.5), new Tuple(500.0, -14.8, 91.5), new Tuple(500.0, -2.8, 79.5), new Tuple(0.0, -2.8, 79.5), new Tuple(0.0, -2.8, -79.5), new Tuple(1000.0, -2.8, 79.5), new Tuple(1000.0, -2.8, -79.5), new Tuple(500.0, -2.8, 79.5), new Tuple(500.0, -2.8, -79.5), new Tuple(0.0, -2.8, -79.5), new Tuple(0.0, -14.8, -91.5), new Tuple(1000.0, -2.8, -79.5), new Tuple(1000.0, -14.8, -91.5), new Tuple(500.0, -2.8, -79.5), new Tuple(500.0, -14.8, -91.5), new Tuple(0.0, -14.8, -91.5), new Tuple(0.0, -50.0, -91.5), new Tuple(1000.0, -14.8, -91.5), new Tuple(1000.0, -50.0, -91.5), new Tuple(500.0, -14.8, -91.5), new Tuple(500.0, -50.0, -91.5), new Tuple(0.0, -50.0, -91.5), new Tuple(0.0, -50.0, -100.0), new Tuple(1000.0, -50.0, -91.5), new Tuple(1000.0, -50.0, -100.0), new Tuple(500.0, -50.0, -91.5), new Tuple(500.0, -50.0, -100.0), new Tuple(0.0, -50.0, -100.0), new Tuple(0.0, 50.0, -100.0), new Tuple(1000.0, -50.0, -100.0), new Tuple(1000.0, 50.0, -100.0), new Tuple(500.0, -50.0, -100.0), new Tuple(500.0, 50.0, -100.0), new Tuple(0.0, 50.0, -100.0), new Tuple(0.0, 50.0, -91.5), new Tuple(1000.0, 50.0, -100.0), new Tuple(1000.0, 50.0, -91.5), new Tuple(500.0, 50.0, -100.0), new Tuple(500.0, 50.0, -91.5), new Tuple(0.0, 50.0, -91.5), new Tuple(0.0, 14.8, -91.5), new Tuple(1000.0, 50.0, -91.5), new Tuple(1000.0, 14.8, -91.5), new Tuple(500.0, 50.0, -91.5), new Tuple(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"); + cartesianPointList3D.AddComment("the geometric representation of the beam is provided as a triangulated face set"); + cartesianPointList3D.AddComment("the meshing depends on the creating software system"); List coordIndex = new List() { 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); + IfcTriangulatedFaceSet triangulatedFaceSet = new IfcTriangulatedFaceSet(cartesianPointList3D, coordIndex); //Unique ids assigned to generate constant IfcScript sample files, remove otherwise return new IfcBeam(building,null, new IfcProductDefinitionShape(new IfcShapeRepresentation(triangulatedFaceSet))) { GlobalId = "0EF5_zZRv0pQPddeofU3KT", Name = "ExampleBeamName",Description = "ExampleBeamDescription",Tag = "Tag" }; diff --git a/IfcScript/Examples/Column.cs b/IfcScript/Examples/Column.cs index 3617144..4fdefa3 100644 --- a/IfcScript/Examples/Column.cs +++ b/IfcScript/Examples/Column.cs @@ -14,15 +14,14 @@ protected override void GenerateInstance(IfcBuilding building) IfcMaterialProfile materialProfile = GetParametericIPE200Profile(database); IfcColumnType columnType = new IfcColumnType(materialProfile.Name, materialProfile, IfcColumnTypeEnum.COLUMN); IfcMaterialProfileSet materialProfileSet = columnType.MaterialSelect as IfcMaterialProfileSet; - IfcColumnStandardCase column = new IfcColumnStandardCase(building, new IfcMaterialProfileSetUsage( materialProfileSet,IfcCardinalPointReference.MID), new IfcAxis2Placement3D(new IfcCartesianPoint(database,0,0,0)), 2000) { Name= materialProfile.Name, RelatingType = columnType }; + IfcColumnStandardCase column = new IfcColumnStandardCase(building, new IfcMaterialProfileSetUsage( materialProfileSet,IfcCardinalPointReference.MID), new IfcAxis2Placement3D(new IfcCartesianPoint(database,0,0,0)), 2000) { Name= materialProfile.Name }; database.Context.AddDeclared(columnType); + column.setRelatingType(columnType); //Unique ids assigned to generate constant IfcScript sample files, remove otherwise columnType.GlobalId = "3qJDCKcPj1tgEHrIL1MUed"; column.GlobalId = "3S1GK_wA565RDoiWQEJc_l"; columnType.ObjectTypeOf.GlobalId = "0QSJIMj99DcOpmktgECZT7"; - columnType.MaterialSelect.Associates.GlobalId = "2RR6JzjWrDuRIDIKRwxCJZ"; - column.MaterialSelect.Associates.GlobalId = "2JRmkBe255UBkcHeZrq_Bl"; } } } diff --git a/IfcScript/Examples/Wall.cs b/IfcScript/Examples/Wall.cs index 0dc3b9f..ad3d57c 100644 --- a/IfcScript/Examples/Wall.cs +++ b/IfcScript/Examples/Wall.cs @@ -28,8 +28,6 @@ protected override void GenerateInstance(IfcBuilding building) //Unique ids assigned to generate constant IfcScript sample files, remove otherwise wallType.GlobalId = "2aG1gZj7PD2PztLOx2$IVX"; wallStandardCase.GlobalId = "0DWgwt6o1FOx7466fPk$jl"; - materialLayerSet.Associates.GlobalId = "36U74BIPDD89cYkx9bkV$Y"; - wallStandardCase.MaterialSelect.Associates.GlobalId = "1BYoVhjtLADPUZYzipA826"; } } diff --git a/IfcScript/IFCExampleBase.cs b/IfcScript/IFCExampleBase.cs index 1e71370..e59196f 100644 --- a/IfcScript/IFCExampleBase.cs +++ b/IfcScript/IFCExampleBase.cs @@ -74,11 +74,11 @@ internal void GenerateExample(string path, ModelView modelView, bool radians) { DatabaseIfc database = GenerateDatabase(modelView, radians); IfcBuilding building = new IfcBuilding(database, "IfcBuilding"); - building.Comments.Add("defines the default building (as required as the minimum spatial element) "); + building.AddComment("defines the default building (as required as the minimum spatial element) "); database.NextObjectRecord = 20; IfcProject project = new IfcProject(building, "IfcProject", IfcUnitAssignment.Length.Millimetre); - project.Comments.Add("general entities required for all IFC sets, defining the context for the exchange"); - database.Factory.SubContext(FactoryIfc.SubContextIdentifier.Body); + project.AddComment("general entities required for all IFC sets, defining the context for the exchange"); + database.Factory.SubContext(IfcGeometricRepresentationSubContext.SubContextIdentifier.Body); database.NextObjectRecord = 50; GenerateInstance(building); ReadOnlyCollection rds = project.Declares; @@ -91,7 +91,7 @@ internal void GenerateExample(string path, ModelView modelView, bool radians) project.GlobalId = "0$WU4A9R19$vKWO$AdOnKA"; project.IsDecomposedBy[0].GlobalId = "091a6ewbvCMQ2Vyiqspa7a"; - database[50].Comments.Add("Example data for " + this.GetType().Name); + database[50].AddComment("Example data for " + this.GetType().Name); WriteFile(database, path); } protected abstract void GenerateInstance(IfcBuilding building); @@ -104,7 +104,6 @@ protected IfcBeamType GetParametericIPE200(DatabaseIfc database) //Unique ids assigned to generate constant IfcScript sample files, remove otherwise beamType.ObjectTypeOf.GlobalId = "3s_DqAVvb3LguudTShJHVo"; - beamType.MaterialSelect.Associates.GlobalId = "0NkGSIHVT3SeAR6bnw7pSa"; return beamType; } @@ -112,11 +111,8 @@ protected IfcMaterialProfile GetParametericIPE200Profile(DatabaseIfc database) { IfcMaterial material = new IfcMaterial(database, "S355JR") { Category = "Steel" }; - //Unique ids assigned to generate constant IfcScript sample files, remove otherwise - material.Associates.GlobalId = "1oJeVe14nCYf5cL0Mka0KL"; - string name = "IPE200"; - IfcIShapeProfileDef ipe200 = new IfcIShapeProfileDef(database, name, 200, 100, 5.6, 8.5, 12); + IfcIShapeProfileDef ipe200 = new IfcIShapeProfileDef(database, name, 200, 200, 5.6, 8.5); return new IfcMaterialProfile(name, material, ipe200); } } diff --git a/IfcScript/IfcScript.csproj b/IfcScript/IfcScript.csproj index 486025b..4ee7018 100644 --- a/IfcScript/IfcScript.csproj +++ b/IfcScript/IfcScript.csproj @@ -81,8 +81,8 @@ false - - ..\packages\GeometryGymIFC.0.0.15\lib\net45\GeometryGymIFC.dll + + ..\packages\GeometryGymIFC.0.1.1\lib\net45\GeometryGymIFC.dll ..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll @@ -99,17 +99,9 @@ - - - - - - - - Form @@ -157,4 +149,4 @@ --> - + \ No newline at end of file diff --git a/IfcScript/app.config b/IfcScript/app.config index c5e1dae..c593f53 100644 --- a/IfcScript/app.config +++ b/IfcScript/app.config @@ -1,3 +1,12 @@ - + - + + + + + + + + + + diff --git a/IfcScript/packages.config b/IfcScript/packages.config index d84c111..996bced 100644 --- a/IfcScript/packages.config +++ b/IfcScript/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file