From 4fd86d7190855bc19951366222f96ce3d1d53d27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20=C4=8Cern=C3=BD?= Date: Wed, 6 Mar 2024 13:46:35 +0100 Subject: [PATCH] feature: EntityCreator supports IFC4.3 --- Tests/BinaryDataTests.cs | 2 +- Tests/Ifc4x3Tests.cs | 13 + Tests/OwnerHistoryTests.cs | 6 +- Tests/Pure4Tests.cs | 4 +- Tests/ValidationTests.cs | 2 +- Xbim.Ifc/Create.cs | 4418 +++++++++++++++++++++++++----------- 6 files changed, 3082 insertions(+), 1363 deletions(-) diff --git a/Tests/BinaryDataTests.cs b/Tests/BinaryDataTests.cs index 233332e66..5d089195f 100644 --- a/Tests/BinaryDataTests.cs +++ b/Tests/BinaryDataTests.cs @@ -90,7 +90,7 @@ private static void PixelTextureTestCode(XbimSchemaVersion version) var data = new List() { new byte[] { 0, 0, 255, 255 }, new byte[] { 0, 255, 255, 255 }, new byte[] { 255, 0, 255, 255 }, new byte[] { 255, 0, 0, 255 } }; using (var model = new MemoryModel(new EntityFactoryIfc4())) { - var create = new Create(model); + var create = new EntityCreator(model); using (var txn = model.BeginTransaction("")) { var pt = create.PixelTexture(t => { diff --git a/Tests/Ifc4x3Tests.cs b/Tests/Ifc4x3Tests.cs index 4c773123c..86da0a9d0 100644 --- a/Tests/Ifc4x3Tests.cs +++ b/Tests/Ifc4x3Tests.cs @@ -12,6 +12,7 @@ using Xbim.Ifc4x3.GeometryResource; using Xbim.Ifc4x3.MeasureResource; using Xbim.Ifc4x3.ProductExtension; +using Xbim.IO.Memory; namespace Xbim.Essentials.Tests { @@ -121,5 +122,17 @@ public void SurfaceDimensionsImplemented() } } + + [TestMethod] + public void CanCreateEntitiesWithFactory() + { + using var model = new MemoryModel(new EntityFactoryIfc4x3Add2()); + using var txn = model.BeginTransaction("Creation"); + + var c = new EntityCreator(model); + c.Wall(w => w.Name = "First wall"); + + txn.Commit(); + } } } diff --git a/Tests/OwnerHistoryTests.cs b/Tests/OwnerHistoryTests.cs index 10fe2b8f9..c6e3b1d6f 100644 --- a/Tests/OwnerHistoryTests.cs +++ b/Tests/OwnerHistoryTests.cs @@ -17,7 +17,7 @@ public void NonEmptyEditorCredentials() { using (var txn = model.BeginTransaction()) { - var create = new Create(model); + var create = new EntityCreator(model); var wall = create.Wall(w => w.Name = "New wall"); Assert.IsNotNull(wall.OwnerHistory); Assert.IsTrue(model.Instances.Count > 1); @@ -33,7 +33,7 @@ public void EmptyEditorCredentials() model.ManageOwnerHistory = false; using (var txn = model.BeginTransaction()) { - var create = new Create(model); + var create = new EntityCreator(model); var wall = create.Wall(w => w.Name = "New wall"); Assert.IsNull(wall.OwnerHistory); Assert.AreEqual(1, model.Instances.Count); @@ -48,7 +48,7 @@ public void NoOwnerHistoryForInsertCopy() { using (var txn = source.BeginTransaction()) { - var create = new Create(source); + var create = new EntityCreator(source); source.ManageOwnerHistory = false; create.Wall(w => w.Name = "New wall #1"); create.Wall(w => w.Name = "New wall #2"); diff --git a/Tests/Pure4Tests.cs b/Tests/Pure4Tests.cs index 4cfcb7eb5..aeeab2cc2 100644 --- a/Tests/Pure4Tests.cs +++ b/Tests/Pure4Tests.cs @@ -22,7 +22,7 @@ public void IndependentCreation() public void CreateDataWithoutInitializers(IModel model) { - var create = new Create(model); + var create = new EntityCreator(model); var wall = create.Wall(); wall.PredefinedType = IfcWallTypeEnum.POLYGONAL; wall.Name = "Name of the perfect wall"; @@ -37,7 +37,7 @@ public void CreateDataWithoutInitializers(IModel model) public void CreateDataWithInitializers(IModel model) { - var create = new Create(model); + var create = new EntityCreator(model); var wall = create.Wall(w => { w.PredefinedType = IfcWallTypeEnum.POLYGONAL; diff --git a/Tests/ValidationTests.cs b/Tests/ValidationTests.cs index 9a0e07843..19a2413d0 100644 --- a/Tests/ValidationTests.cs +++ b/Tests/ValidationTests.cs @@ -46,7 +46,7 @@ public void ContextDependentUnitValidationTest() { using (var txn = model.BeginTransaction()) { - var c = new Create(model); + var c = new EntityCreator(model); var unit = c.ContextDependentUnit(u => { u.UnitType = IfcUnitEnum.USERDEFINED; diff --git a/Xbim.Ifc/Create.cs b/Xbim.Ifc/Create.cs index 77d1e4308..a91e8abc3 100644 --- a/Xbim.Ifc/Create.cs +++ b/Xbim.Ifc/Create.cs @@ -13,3117 +13,4823 @@ // ReSharper disable once CheckNamespace namespace Xbim.Ifc4.Interfaces { - public class Create: IDisposable + public class EntityCreator { private readonly IModel _model; private readonly XbimSchemaVersion _version; - public Create(IModel model) + public EntityCreator(IModel model) { _model = model; - - var stepSchema = model.Header.FileSchema; - foreach (var schema in stepSchema.Schemas) - { - if (string.Equals(schema, "Ifc4", StringComparison.OrdinalIgnoreCase) || - schema.StartsWith("Ifc4RC", StringComparison.OrdinalIgnoreCase)) - _version = XbimSchemaVersion.Ifc4; - else if (schema.StartsWith("Ifc2x", StringComparison.OrdinalIgnoreCase)) //return this as 2x3 - _version = XbimSchemaVersion.Ifc2X3; - else - throw new NotSupportedException("Only IFC2x3 and IFC4 schemas are supported."); - } + _version = model.SchemaVersion; } public IIfcActionRequest ActionRequest(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcActionRequest is not supported in schema {_version}") + }; } public IIfcActor Actor(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcActor is not supported in schema {_version}") + }; } public IIfcActorRole ActorRole(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcActorRole is not supported in schema {_version}") + }; } public IIfcActuatorType ActuatorType(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcActuatorType is not supported in schema {_version}") + }; } public IIfcAirTerminalBoxType AirTerminalBoxType(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcAirTerminalBoxType is not supported in schema {_version}") + }; } public IIfcAirTerminalType AirTerminalType(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcAirTerminalType is not supported in schema {_version}") + }; } public IIfcAirToAirHeatRecoveryType AirToAirHeatRecoveryType(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcAirToAirHeatRecoveryType is not supported in schema {_version}") + }; } public IIfcAlarmType AlarmType(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcAlarmType is not supported in schema {_version}") + }; } public IIfcAnnotation Annotation(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcAnnotation is not supported in schema {_version}") + }; } public IIfcAnnotationFillArea AnnotationFillArea(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcAnnotationFillArea is not supported in schema {_version}") + }; } public IIfcApplication Application(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcApplication is not supported in schema {_version}") + }; } public IIfcApproval Approval(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcApproval is not supported in schema {_version}") + }; } public IIfcApprovalRelationship ApprovalRelationship(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcApprovalRelationship is not supported in schema {_version}") + }; } public IIfcArbitraryClosedProfileDef ArbitraryClosedProfileDef(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcArbitraryClosedProfileDef is not supported in schema {_version}") + }; } public IIfcArbitraryOpenProfileDef ArbitraryOpenProfileDef(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcArbitraryOpenProfileDef is not supported in schema {_version}") + }; } public IIfcArbitraryProfileDefWithVoids ArbitraryProfileDefWithVoids(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcArbitraryProfileDefWithVoids is not supported in schema {_version}") + }; } public IIfcAsset Asset(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcAsset is not supported in schema {_version}") + }; } public IIfcAsymmetricIShapeProfileDef AsymmetricIShapeProfileDef(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcAsymmetricIShapeProfileDef is not supported in schema {_version}") + }; } public IIfcAxis1Placement Axis1Placement(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcAxis1Placement is not supported in schema {_version}") + }; } public IIfcAxis2Placement2D Axis2Placement2D(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcAxis2Placement2D is not supported in schema {_version}") + }; } public IIfcAxis2Placement3D Axis2Placement3D(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcAxis2Placement3D is not supported in schema {_version}") + }; } public IIfcBeam Beam(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcBeam is not supported in schema {_version}") + }; } public IIfcBeamType BeamType(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcBeamType is not supported in schema {_version}") + }; } public IIfcBlobTexture BlobTexture(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcBlobTexture is not supported in schema {_version}") + }; } public IIfcBlock Block(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcBlock is not supported in schema {_version}") + }; } public IIfcBoilerType BoilerType(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcBoilerType is not supported in schema {_version}") + }; } public IIfcBooleanClippingResult BooleanClippingResult(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcBooleanClippingResult is not supported in schema {_version}") + }; } public IIfcBooleanResult BooleanResult(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcBooleanResult is not supported in schema {_version}") + }; } public IIfcBoundaryEdgeCondition BoundaryEdgeCondition(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcBoundaryEdgeCondition is not supported in schema {_version}") + }; } public IIfcBoundaryFaceCondition BoundaryFaceCondition(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcBoundaryFaceCondition is not supported in schema {_version}") + }; } public IIfcBoundaryNodeCondition BoundaryNodeCondition(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcBoundaryNodeCondition is not supported in schema {_version}") + }; } public IIfcBoundaryNodeConditionWarping BoundaryNodeConditionWarping(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcBoundaryNodeConditionWarping is not supported in schema {_version}") + }; } public IIfcBoundingBox BoundingBox(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcBoundingBox is not supported in schema {_version}") + }; } public IIfcBoxedHalfSpace BoxedHalfSpace(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcBoxedHalfSpace is not supported in schema {_version}") + }; } public IIfcBuilding Building(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcBuilding is not supported in schema {_version}") + }; } public IIfcBuildingElementPart BuildingElementPart(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcBuildingElementPart is not supported in schema {_version}") + }; } public IIfcBuildingElementProxy BuildingElementProxy(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcBuildingElementProxy is not supported in schema {_version}") + }; } public IIfcBuildingElementProxyType BuildingElementProxyType(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcBuildingElementProxyType is not supported in schema {_version}") + }; } public IIfcBuildingStorey BuildingStorey(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcBuildingStorey is not supported in schema {_version}") + }; } public IIfcCShapeProfileDef CShapeProfileDef(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcCShapeProfileDef is not supported in schema {_version}") + }; } public IIfcCableCarrierFittingType CableCarrierFittingType(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcCableCarrierFittingType is not supported in schema {_version}") + }; } public IIfcCableCarrierSegmentType CableCarrierSegmentType(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcCableCarrierSegmentType is not supported in schema {_version}") + }; } public IIfcCableSegmentType CableSegmentType(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcCableSegmentType is not supported in schema {_version}") + }; } public IIfcCartesianPoint CartesianPoint(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcCartesianPoint is not supported in schema {_version}") + }; } public IIfcCartesianTransformationOperator2D CartesianTransformationOperator2D(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcCartesianTransformationOperator2D is not supported in schema {_version}") + }; } public IIfcCartesianTransformationOperator2DnonUniform CartesianTransformationOperator2DnonUniform(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcCartesianTransformationOperator2DnonUniform is not supported in schema {_version}") + }; } public IIfcCartesianTransformationOperator3D CartesianTransformationOperator3D(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcCartesianTransformationOperator3D is not supported in schema {_version}") + }; } public IIfcCartesianTransformationOperator3DnonUniform CartesianTransformationOperator3DnonUniform(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcCartesianTransformationOperator3DnonUniform is not supported in schema {_version}") + }; } public IIfcCenterLineProfileDef CenterLineProfileDef(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcCenterLineProfileDef is not supported in schema {_version}") + }; } public IIfcChillerType ChillerType(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcChillerType is not supported in schema {_version}") + }; } public IIfcCircle Circle(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcCircle is not supported in schema {_version}") + }; } public IIfcCircleHollowProfileDef CircleHollowProfileDef(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcCircleHollowProfileDef is not supported in schema {_version}") + }; } public IIfcCircleProfileDef CircleProfileDef(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcCircleProfileDef is not supported in schema {_version}") + }; } public IIfcClassification Classification(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcClassification is not supported in schema {_version}") + }; } public IIfcClassificationReference ClassificationReference(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcClassificationReference is not supported in schema {_version}") + }; } public IIfcClosedShell ClosedShell(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcClosedShell is not supported in schema {_version}") + }; } public IIfcCoilType CoilType(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcCoilType is not supported in schema {_version}") + }; } public IIfcColourRgb ColourRgb(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcColourRgb is not supported in schema {_version}") + }; } public IIfcColumn Column(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcColumn is not supported in schema {_version}") + }; } public IIfcColumnType ColumnType(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcColumnType is not supported in schema {_version}") + }; } public IIfcComplexProperty ComplexProperty(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcComplexProperty is not supported in schema {_version}") + }; } public IIfcCompositeCurve CompositeCurve(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcCompositeCurve is not supported in schema {_version}") + }; } public IIfcCompositeCurveSegment CompositeCurveSegment(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcCompositeCurveSegment is not supported in schema {_version}") + }; } public IIfcCompositeProfileDef CompositeProfileDef(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcCompositeProfileDef is not supported in schema {_version}") + }; } public IIfcCompressorType CompressorType(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcCompressorType is not supported in schema {_version}") + }; } public IIfcCondenserType CondenserType(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcCondenserType is not supported in schema {_version}") + }; } public IIfcConnectedFaceSet ConnectedFaceSet(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcConnectedFaceSet is not supported in schema {_version}") + }; } public IIfcConnectionCurveGeometry ConnectionCurveGeometry(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcConnectionCurveGeometry is not supported in schema {_version}") + }; } public IIfcConnectionPointEccentricity ConnectionPointEccentricity(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcConnectionPointEccentricity is not supported in schema {_version}") + }; } public IIfcConnectionPointGeometry ConnectionPointGeometry(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcConnectionPointGeometry is not supported in schema {_version}") + }; } public IIfcConnectionSurfaceGeometry ConnectionSurfaceGeometry(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcConnectionSurfaceGeometry is not supported in schema {_version}") + }; } public IIfcConstructionEquipmentResource ConstructionEquipmentResource(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcConstructionEquipmentResource is not supported in schema {_version}") + }; } public IIfcConstructionMaterialResource ConstructionMaterialResource(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcConstructionMaterialResource is not supported in schema {_version}") + }; } public IIfcConstructionProductResource ConstructionProductResource(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcConstructionProductResource is not supported in schema {_version}") + }; } public IIfcContextDependentUnit ContextDependentUnit(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcContextDependentUnit is not supported in schema {_version}") + }; } public IIfcControllerType ControllerType(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcControllerType is not supported in schema {_version}") + }; } public IIfcConversionBasedUnit ConversionBasedUnit(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcConversionBasedUnit is not supported in schema {_version}") + }; } public IIfcCooledBeamType CooledBeamType(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcCooledBeamType is not supported in schema {_version}") + }; } public IIfcCoolingTowerType CoolingTowerType(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcCoolingTowerType is not supported in schema {_version}") + }; } public IIfcCostItem CostItem(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcCostItem is not supported in schema {_version}") + }; } public IIfcCostSchedule CostSchedule(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcCostSchedule is not supported in schema {_version}") + }; } public IIfcCostValue CostValue(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcCostValue is not supported in schema {_version}") + }; } public IIfcCovering Covering(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcCovering is not supported in schema {_version}") + }; } public IIfcCoveringType CoveringType(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcCoveringType is not supported in schema {_version}") + }; } public IIfcCrewResource CrewResource(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcCrewResource is not supported in schema {_version}") + }; } public IIfcCsgSolid CsgSolid(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcCsgSolid is not supported in schema {_version}") + }; } public IIfcCurrencyRelationship CurrencyRelationship(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcCurrencyRelationship is not supported in schema {_version}") + }; } public IIfcCurtainWall CurtainWall(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcCurtainWall is not supported in schema {_version}") + }; } public IIfcCurtainWallType CurtainWallType(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcCurtainWallType is not supported in schema {_version}") + }; } public IIfcCurveBoundedPlane CurveBoundedPlane(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcCurveBoundedPlane is not supported in schema {_version}") + }; } public IIfcCurveStyle CurveStyle(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcCurveStyle is not supported in schema {_version}") + }; } public IIfcCurveStyleFont CurveStyleFont(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcCurveStyleFont is not supported in schema {_version}") + }; } public IIfcCurveStyleFontAndScaling CurveStyleFontAndScaling(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcCurveStyleFontAndScaling is not supported in schema {_version}") + }; } public IIfcCurveStyleFontPattern CurveStyleFontPattern(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcCurveStyleFontPattern is not supported in schema {_version}") + }; } public IIfcDamperType DamperType(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcDamperType is not supported in schema {_version}") + }; } public IIfcDerivedProfileDef DerivedProfileDef(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcDerivedProfileDef is not supported in schema {_version}") + }; } public IIfcDerivedUnit DerivedUnit(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcDerivedUnit is not supported in schema {_version}") + }; } public IIfcDerivedUnitElement DerivedUnitElement(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcDerivedUnitElement is not supported in schema {_version}") + }; } public IIfcDimensionalExponents DimensionalExponents(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcDimensionalExponents is not supported in schema {_version}") + }; } public IIfcDirection Direction(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcDirection is not supported in schema {_version}") + }; } public IIfcDiscreteAccessory DiscreteAccessory(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcDiscreteAccessory is not supported in schema {_version}") + }; } public IIfcDiscreteAccessoryType DiscreteAccessoryType(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcDiscreteAccessoryType is not supported in schema {_version}") + }; } public IIfcDistributionChamberElement DistributionChamberElement(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcDistributionChamberElement is not supported in schema {_version}") + }; } public IIfcDistributionChamberElementType DistributionChamberElementType(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcDistributionChamberElementType is not supported in schema {_version}") + }; } public IIfcDistributionControlElement DistributionControlElement(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcDistributionControlElement is not supported in schema {_version}") + }; } public IIfcDistributionElement DistributionElement(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcDistributionElement is not supported in schema {_version}") + }; } public IIfcDistributionElementType DistributionElementType(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcDistributionElementType is not supported in schema {_version}") + }; } public IIfcDistributionFlowElement DistributionFlowElement(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcDistributionFlowElement is not supported in schema {_version}") + }; } public IIfcDistributionPort DistributionPort(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcDistributionPort is not supported in schema {_version}") + }; } public IIfcDocumentInformation DocumentInformation(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcDocumentInformation is not supported in schema {_version}") + }; } public IIfcDocumentInformationRelationship DocumentInformationRelationship(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcDocumentInformationRelationship is not supported in schema {_version}") + }; } public IIfcDocumentReference DocumentReference(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcDocumentReference is not supported in schema {_version}") + }; } public IIfcDoor Door(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcDoor is not supported in schema {_version}") + }; } public IIfcDoorLiningProperties DoorLiningProperties(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcDoorLiningProperties is not supported in schema {_version}") + }; } public IIfcDoorPanelProperties DoorPanelProperties(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); - } - - public IIfcDoorStyle DoorStyle(Action init = null) - { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcDoorPanelProperties is not supported in schema {_version}") + }; } public IIfcDraughtingPreDefinedColour DraughtingPreDefinedColour(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcDraughtingPreDefinedColour is not supported in schema {_version}") + }; } public IIfcDraughtingPreDefinedCurveFont DraughtingPreDefinedCurveFont(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcDraughtingPreDefinedCurveFont is not supported in schema {_version}") + }; } public IIfcDuctFittingType DuctFittingType(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcDuctFittingType is not supported in schema {_version}") + }; } public IIfcDuctSegmentType DuctSegmentType(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcDuctSegmentType is not supported in schema {_version}") + }; } public IIfcDuctSilencerType DuctSilencerType(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcDuctSilencerType is not supported in schema {_version}") + }; } public IIfcEdge Edge(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcEdge is not supported in schema {_version}") + }; } public IIfcEdgeCurve EdgeCurve(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcEdgeCurve is not supported in schema {_version}") + }; } public IIfcEdgeLoop EdgeLoop(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcEdgeLoop is not supported in schema {_version}") + }; } public IIfcElectricApplianceType ElectricApplianceType(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcElectricApplianceType is not supported in schema {_version}") + }; } public IIfcElectricFlowStorageDeviceType ElectricFlowStorageDeviceType(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcElectricFlowStorageDeviceType is not supported in schema {_version}") + }; } public IIfcElectricGeneratorType ElectricGeneratorType(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcElectricGeneratorType is not supported in schema {_version}") + }; } public IIfcElectricMotorType ElectricMotorType(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcElectricMotorType is not supported in schema {_version}") + }; } public IIfcElectricTimeControlType ElectricTimeControlType(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcElectricTimeControlType is not supported in schema {_version}") + }; } public IIfcElementAssembly ElementAssembly(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcElementAssembly is not supported in schema {_version}") + }; } public IIfcElementQuantity ElementQuantity(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcElementQuantity is not supported in schema {_version}") + }; } public IIfcEllipse Ellipse(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcEllipse is not supported in schema {_version}") + }; } public IIfcEllipseProfileDef EllipseProfileDef(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcEllipseProfileDef is not supported in schema {_version}") + }; } public IIfcEnergyConversionDevice EnergyConversionDevice(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcEnergyConversionDevice is not supported in schema {_version}") + }; } public IIfcEvaporativeCoolerType EvaporativeCoolerType(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcEvaporativeCoolerType is not supported in schema {_version}") + }; } public IIfcEvaporatorType EvaporatorType(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcEvaporatorType is not supported in schema {_version}") + }; } public IIfcExternallyDefinedHatchStyle ExternallyDefinedHatchStyle(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcExternallyDefinedHatchStyle is not supported in schema {_version}") + }; } public IIfcExternallyDefinedSurfaceStyle ExternallyDefinedSurfaceStyle(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcExternallyDefinedSurfaceStyle is not supported in schema {_version}") + }; } public IIfcExternallyDefinedTextFont ExternallyDefinedTextFont(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcExternallyDefinedTextFont is not supported in schema {_version}") + }; } public IIfcExtrudedAreaSolid ExtrudedAreaSolid(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcExtrudedAreaSolid is not supported in schema {_version}") + }; } public IIfcFace Face(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcFace is not supported in schema {_version}") + }; } public IIfcFaceBasedSurfaceModel FaceBasedSurfaceModel(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcFaceBasedSurfaceModel is not supported in schema {_version}") + }; } public IIfcFaceBound FaceBound(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcFaceBound is not supported in schema {_version}") + }; } public IIfcFaceOuterBound FaceOuterBound(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcFaceOuterBound is not supported in schema {_version}") + }; } public IIfcFaceSurface FaceSurface(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcFaceSurface is not supported in schema {_version}") + }; } public IIfcFacetedBrep FacetedBrep(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcFacetedBrep is not supported in schema {_version}") + }; } public IIfcFacetedBrepWithVoids FacetedBrepWithVoids(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcFacetedBrepWithVoids is not supported in schema {_version}") + }; } public IIfcFailureConnectionCondition FailureConnectionCondition(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcFailureConnectionCondition is not supported in schema {_version}") + }; } public IIfcFanType FanType(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcFanType is not supported in schema {_version}") + }; } public IIfcFastener Fastener(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcFastener is not supported in schema {_version}") + }; } public IIfcFastenerType FastenerType(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcFastenerType is not supported in schema {_version}") + }; } public IIfcFillAreaStyle FillAreaStyle(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcFillAreaStyle is not supported in schema {_version}") + }; } public IIfcFillAreaStyleHatching FillAreaStyleHatching(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcFillAreaStyleHatching is not supported in schema {_version}") + }; } public IIfcFillAreaStyleTiles FillAreaStyleTiles(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcFillAreaStyleTiles is not supported in schema {_version}") + }; } public IIfcFilterType FilterType(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcFilterType is not supported in schema {_version}") + }; } public IIfcFireSuppressionTerminalType FireSuppressionTerminalType(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcFireSuppressionTerminalType is not supported in schema {_version}") + }; } public IIfcFlowController FlowController(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcFlowController is not supported in schema {_version}") + }; } public IIfcFlowFitting FlowFitting(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcFlowFitting is not supported in schema {_version}") + }; } public IIfcFlowInstrumentType FlowInstrumentType(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcFlowInstrumentType is not supported in schema {_version}") + }; } public IIfcFlowMeterType FlowMeterType(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcFlowMeterType is not supported in schema {_version}") + }; } public IIfcFlowMovingDevice FlowMovingDevice(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcFlowMovingDevice is not supported in schema {_version}") + }; } public IIfcFlowSegment FlowSegment(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcFlowSegment is not supported in schema {_version}") + }; } public IIfcFlowStorageDevice FlowStorageDevice(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcFlowStorageDevice is not supported in schema {_version}") + }; } public IIfcFlowTerminal FlowTerminal(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcFlowTerminal is not supported in schema {_version}") + }; } public IIfcFlowTreatmentDevice FlowTreatmentDevice(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcFlowTreatmentDevice is not supported in schema {_version}") + }; } public IIfcFooting Footing(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcFooting is not supported in schema {_version}") + }; } public IIfcFurnishingElement FurnishingElement(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcFurnishingElement is not supported in schema {_version}") + }; } public IIfcFurnishingElementType FurnishingElementType(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcFurnishingElementType is not supported in schema {_version}") + }; } public IIfcFurnitureType FurnitureType(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcFurnitureType is not supported in schema {_version}") + }; } public IIfcGeometricCurveSet GeometricCurveSet(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcGeometricCurveSet is not supported in schema {_version}") + }; } public IIfcGeometricRepresentationContext GeometricRepresentationContext(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcGeometricRepresentationContext is not supported in schema {_version}") + }; } public IIfcGeometricRepresentationSubContext GeometricRepresentationSubContext(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcGeometricRepresentationSubContext is not supported in schema {_version}") + }; } public IIfcGeometricSet GeometricSet(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcGeometricSet is not supported in schema {_version}") + }; } public IIfcGrid Grid(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcGrid is not supported in schema {_version}") + }; } public IIfcGridAxis GridAxis(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcGridAxis is not supported in schema {_version}") + }; } public IIfcGridPlacement GridPlacement(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcGridPlacement is not supported in schema {_version}") + }; } public IIfcGroup Group(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcGroup is not supported in schema {_version}") + }; } public IIfcHalfSpaceSolid HalfSpaceSolid(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcHalfSpaceSolid is not supported in schema {_version}") + }; } public IIfcHeatExchangerType HeatExchangerType(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcHeatExchangerType is not supported in schema {_version}") + }; } public IIfcHumidifierType HumidifierType(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcHumidifierType is not supported in schema {_version}") + }; } public IIfcIShapeProfileDef IShapeProfileDef(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcIShapeProfileDef is not supported in schema {_version}") + }; } public IIfcImageTexture ImageTexture(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcImageTexture is not supported in schema {_version}") + }; } public IIfcInventory Inventory(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcInventory is not supported in schema {_version}") + }; } public IIfcIrregularTimeSeries IrregularTimeSeries(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcIrregularTimeSeries is not supported in schema {_version}") + }; } public IIfcIrregularTimeSeriesValue IrregularTimeSeriesValue(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcIrregularTimeSeriesValue is not supported in schema {_version}") + }; } public IIfcJunctionBoxType JunctionBoxType(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcJunctionBoxType is not supported in schema {_version}") + }; } public IIfcLShapeProfileDef LShapeProfileDef(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcLShapeProfileDef is not supported in schema {_version}") + }; } public IIfcLaborResource LaborResource(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcLaborResource is not supported in schema {_version}") + }; } public IIfcLampType LampType(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcLampType is not supported in schema {_version}") + }; } public IIfcLibraryInformation LibraryInformation(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcLibraryInformation is not supported in schema {_version}") + }; } public IIfcLibraryReference LibraryReference(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcLibraryReference is not supported in schema {_version}") + }; } public IIfcLightDistributionData LightDistributionData(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcLightDistributionData is not supported in schema {_version}") + }; } public IIfcLightFixtureType LightFixtureType(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcLightFixtureType is not supported in schema {_version}") + }; } public IIfcLightIntensityDistribution LightIntensityDistribution(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcLightIntensityDistribution is not supported in schema {_version}") + }; } public IIfcLightSourceAmbient LightSourceAmbient(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcLightSourceAmbient is not supported in schema {_version}") + }; } public IIfcLightSourceDirectional LightSourceDirectional(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcLightSourceDirectional is not supported in schema {_version}") + }; } public IIfcLightSourceGoniometric LightSourceGoniometric(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcLightSourceGoniometric is not supported in schema {_version}") + }; } public IIfcLightSourcePositional LightSourcePositional(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcLightSourcePositional is not supported in schema {_version}") + }; } public IIfcLightSourceSpot LightSourceSpot(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcLightSourceSpot is not supported in schema {_version}") + }; } public IIfcLine Line(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcLine is not supported in schema {_version}") + }; } public IIfcLocalPlacement LocalPlacement(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcLocalPlacement is not supported in schema {_version}") + }; } public IIfcLoop Loop(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcLoop is not supported in schema {_version}") + }; } public IIfcMappedItem MappedItem(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcMappedItem is not supported in schema {_version}") + }; } public IIfcMaterial Material(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcMaterial is not supported in schema {_version}") + }; } public IIfcMaterialClassificationRelationship MaterialClassificationRelationship(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcMaterialClassificationRelationship is not supported in schema {_version}") + }; } public IIfcMaterialDefinitionRepresentation MaterialDefinitionRepresentation(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcMaterialDefinitionRepresentation is not supported in schema {_version}") + }; } public IIfcMaterialLayer MaterialLayer(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcMaterialLayer is not supported in schema {_version}") + }; } public IIfcMaterialLayerSet MaterialLayerSet(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcMaterialLayerSet is not supported in schema {_version}") + }; } public IIfcMaterialLayerSetUsage MaterialLayerSetUsage(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcMaterialLayerSetUsage is not supported in schema {_version}") + }; } public IIfcMaterialList MaterialList(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcMaterialList is not supported in schema {_version}") + }; } public IIfcMeasureWithUnit MeasureWithUnit(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcMeasureWithUnit is not supported in schema {_version}") + }; } public IIfcMechanicalFastener MechanicalFastener(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcMechanicalFastener is not supported in schema {_version}") + }; } public IIfcMechanicalFastenerType MechanicalFastenerType(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcMechanicalFastenerType is not supported in schema {_version}") + }; } public IIfcMember Member(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcMember is not supported in schema {_version}") + }; } public IIfcMemberType MemberType(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcMemberType is not supported in schema {_version}") + }; } public IIfcMetric Metric(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcMetric is not supported in schema {_version}") + }; } public IIfcMonetaryUnit MonetaryUnit(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcMonetaryUnit is not supported in schema {_version}") + }; } public IIfcMotorConnectionType MotorConnectionType(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcMotorConnectionType is not supported in schema {_version}") + }; } public IIfcObjective Objective(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcObjective is not supported in schema {_version}") + }; } public IIfcOccupant Occupant(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcOccupant is not supported in schema {_version}") + }; } public IIfcOffsetCurve2D OffsetCurve2D(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcOffsetCurve2D is not supported in schema {_version}") + }; } public IIfcOffsetCurve3D OffsetCurve3D(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcOffsetCurve3D is not supported in schema {_version}") + }; } public IIfcOpenShell OpenShell(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcOpenShell is not supported in schema {_version}") + }; } public IIfcOpeningElement OpeningElement(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcOpeningElement is not supported in schema {_version}") + }; } public IIfcOrganization Organization(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcOrganization is not supported in schema {_version}") + }; } public IIfcOrganizationRelationship OrganizationRelationship(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcOrganizationRelationship is not supported in schema {_version}") + }; } public IIfcOrientedEdge OrientedEdge(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcOrientedEdge is not supported in schema {_version}") + }; } public IIfcOutletType OutletType(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcOutletType is not supported in schema {_version}") + }; } public IIfcOwnerHistory OwnerHistory(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcOwnerHistory is not supported in schema {_version}") + }; } public IIfcPath Path(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcPath is not supported in schema {_version}") + }; } public IIfcPerformanceHistory PerformanceHistory(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcPerformanceHistory is not supported in schema {_version}") + }; } public IIfcPermeableCoveringProperties PermeableCoveringProperties(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcPermeableCoveringProperties is not supported in schema {_version}") + }; } public IIfcPermit Permit(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcPermit is not supported in schema {_version}") + }; } public IIfcPerson Person(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcPerson is not supported in schema {_version}") + }; } public IIfcPersonAndOrganization PersonAndOrganization(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcPersonAndOrganization is not supported in schema {_version}") + }; } public IIfcPhysicalComplexQuantity PhysicalComplexQuantity(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcPhysicalComplexQuantity is not supported in schema {_version}") + }; } public IIfcPile Pile(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcPile is not supported in schema {_version}") + }; } public IIfcPipeFittingType PipeFittingType(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcPipeFittingType is not supported in schema {_version}") + }; } public IIfcPipeSegmentType PipeSegmentType(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcPipeSegmentType is not supported in schema {_version}") + }; } public IIfcPixelTexture PixelTexture(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcPixelTexture is not supported in schema {_version}") + }; } public IIfcPlanarBox PlanarBox(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcPlanarBox is not supported in schema {_version}") + }; } public IIfcPlanarExtent PlanarExtent(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcPlanarExtent is not supported in schema {_version}") + }; } public IIfcPlane Plane(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcPlane is not supported in schema {_version}") + }; } public IIfcPlate Plate(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcPlate is not supported in schema {_version}") + }; } public IIfcPlateType PlateType(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcPlateType is not supported in schema {_version}") + }; } public IIfcPointOnCurve PointOnCurve(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcPointOnCurve is not supported in schema {_version}") + }; } public IIfcPointOnSurface PointOnSurface(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcPointOnSurface is not supported in schema {_version}") + }; } public IIfcPolyLoop PolyLoop(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcPolyLoop is not supported in schema {_version}") + }; } public IIfcPolygonalBoundedHalfSpace PolygonalBoundedHalfSpace(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcPolygonalBoundedHalfSpace is not supported in schema {_version}") + }; } public IIfcPolyline Polyline(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcPolyline is not supported in schema {_version}") + }; } public IIfcPostalAddress PostalAddress(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcPostalAddress is not supported in schema {_version}") + }; } public IIfcPresentationLayerAssignment PresentationLayerAssignment(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcPresentationLayerAssignment is not supported in schema {_version}") + }; } public IIfcPresentationLayerWithStyle PresentationLayerWithStyle(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); - } - - public IIfcPresentationStyleAssignment PresentationStyleAssignment(Action init = null) - { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcPresentationLayerWithStyle is not supported in schema {_version}") + }; } public IIfcProcedure Procedure(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcProcedure is not supported in schema {_version}") + }; } public IIfcProductDefinitionShape ProductDefinitionShape(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcProductDefinitionShape is not supported in schema {_version}") + }; } public IIfcProject Project(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcProject is not supported in schema {_version}") + }; } public IIfcProjectOrder ProjectOrder(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcProjectOrder is not supported in schema {_version}") + }; } public IIfcProjectionElement ProjectionElement(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcProjectionElement is not supported in schema {_version}") + }; } public IIfcPropertyBoundedValue PropertyBoundedValue(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcPropertyBoundedValue is not supported in schema {_version}") + }; } public IIfcPropertyDependencyRelationship PropertyDependencyRelationship(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcPropertyDependencyRelationship is not supported in schema {_version}") + }; } public IIfcPropertyEnumeratedValue PropertyEnumeratedValue(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcPropertyEnumeratedValue is not supported in schema {_version}") + }; } public IIfcPropertyEnumeration PropertyEnumeration(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcPropertyEnumeration is not supported in schema {_version}") + }; } public IIfcPropertyListValue PropertyListValue(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcPropertyListValue is not supported in schema {_version}") + }; } public IIfcPropertyReferenceValue PropertyReferenceValue(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcPropertyReferenceValue is not supported in schema {_version}") + }; } public IIfcPropertySet PropertySet(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcPropertySet is not supported in schema {_version}") + }; } public IIfcPropertySingleValue PropertySingleValue(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcPropertySingleValue is not supported in schema {_version}") + }; } public IIfcPropertyTableValue PropertyTableValue(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcPropertyTableValue is not supported in schema {_version}") + }; } public IIfcProtectiveDeviceType ProtectiveDeviceType(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); - } - - public IIfcProxy Proxy(Action init = null) - { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcProtectiveDeviceType is not supported in schema {_version}") + }; } public IIfcPumpType PumpType(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcPumpType is not supported in schema {_version}") + }; } public IIfcQuantityArea QuantityArea(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcQuantityArea is not supported in schema {_version}") + }; } public IIfcQuantityCount QuantityCount(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcQuantityCount is not supported in schema {_version}") + }; } public IIfcQuantityLength QuantityLength(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcQuantityLength is not supported in schema {_version}") + }; } public IIfcQuantityTime QuantityTime(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcQuantityTime is not supported in schema {_version}") + }; } public IIfcQuantityVolume QuantityVolume(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcQuantityVolume is not supported in schema {_version}") + }; } public IIfcQuantityWeight QuantityWeight(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcQuantityWeight is not supported in schema {_version}") + }; } public IIfcRailing Railing(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcRailing is not supported in schema {_version}") + }; } public IIfcRailingType RailingType(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcRailingType is not supported in schema {_version}") + }; } public IIfcRamp Ramp(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcRamp is not supported in schema {_version}") + }; } public IIfcRampFlight RampFlight(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcRampFlight is not supported in schema {_version}") + }; } public IIfcRampFlightType RampFlightType(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcRampFlightType is not supported in schema {_version}") + }; } public IIfcRectangleHollowProfileDef RectangleHollowProfileDef(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcRectangleHollowProfileDef is not supported in schema {_version}") + }; } public IIfcRectangleProfileDef RectangleProfileDef(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcRectangleProfileDef is not supported in schema {_version}") + }; } public IIfcRectangularPyramid RectangularPyramid(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcRectangularPyramid is not supported in schema {_version}") + }; } public IIfcRectangularTrimmedSurface RectangularTrimmedSurface(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcRectangularTrimmedSurface is not supported in schema {_version}") + }; } public IIfcRegularTimeSeries RegularTimeSeries(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcRegularTimeSeries is not supported in schema {_version}") + }; } public IIfcReinforcementBarProperties ReinforcementBarProperties(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcReinforcementBarProperties is not supported in schema {_version}") + }; } public IIfcReinforcementDefinitionProperties ReinforcementDefinitionProperties(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcReinforcementDefinitionProperties is not supported in schema {_version}") + }; } public IIfcReinforcingBar ReinforcingBar(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcReinforcingBar is not supported in schema {_version}") + }; } public IIfcReinforcingMesh ReinforcingMesh(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcReinforcingMesh is not supported in schema {_version}") + }; } public IIfcRelAggregates RelAggregates(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcRelAggregates is not supported in schema {_version}") + }; } public IIfcRelAssignsToActor RelAssignsToActor(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcRelAssignsToActor is not supported in schema {_version}") + }; } public IIfcRelAssignsToControl RelAssignsToControl(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcRelAssignsToControl is not supported in schema {_version}") + }; } public IIfcRelAssignsToGroup RelAssignsToGroup(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcRelAssignsToGroup is not supported in schema {_version}") + }; } public IIfcRelAssignsToProcess RelAssignsToProcess(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcRelAssignsToProcess is not supported in schema {_version}") + }; } public IIfcRelAssignsToProduct RelAssignsToProduct(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcRelAssignsToProduct is not supported in schema {_version}") + }; } public IIfcRelAssignsToResource RelAssignsToResource(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcRelAssignsToResource is not supported in schema {_version}") + }; } public IIfcRelAssociatesApproval RelAssociatesApproval(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcRelAssociatesApproval is not supported in schema {_version}") + }; } public IIfcRelAssociatesClassification RelAssociatesClassification(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcRelAssociatesClassification is not supported in schema {_version}") + }; } public IIfcRelAssociatesConstraint RelAssociatesConstraint(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcRelAssociatesConstraint is not supported in schema {_version}") + }; } public IIfcRelAssociatesDocument RelAssociatesDocument(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcRelAssociatesDocument is not supported in schema {_version}") + }; } public IIfcRelAssociatesLibrary RelAssociatesLibrary(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcRelAssociatesLibrary is not supported in schema {_version}") + }; } public IIfcRelAssociatesMaterial RelAssociatesMaterial(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcRelAssociatesMaterial is not supported in schema {_version}") + }; } public IIfcRelConnectsElements RelConnectsElements(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcRelConnectsElements is not supported in schema {_version}") + }; } public IIfcRelConnectsPathElements RelConnectsPathElements(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcRelConnectsPathElements is not supported in schema {_version}") + }; } public IIfcRelConnectsPortToElement RelConnectsPortToElement(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcRelConnectsPortToElement is not supported in schema {_version}") + }; } public IIfcRelConnectsPorts RelConnectsPorts(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcRelConnectsPorts is not supported in schema {_version}") + }; } public IIfcRelConnectsStructuralActivity RelConnectsStructuralActivity(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcRelConnectsStructuralActivity is not supported in schema {_version}") + }; } public IIfcRelConnectsStructuralMember RelConnectsStructuralMember(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcRelConnectsStructuralMember is not supported in schema {_version}") + }; } public IIfcRelConnectsWithEccentricity RelConnectsWithEccentricity(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcRelConnectsWithEccentricity is not supported in schema {_version}") + }; } public IIfcRelConnectsWithRealizingElements RelConnectsWithRealizingElements(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcRelConnectsWithRealizingElements is not supported in schema {_version}") + }; } public IIfcRelContainedInSpatialStructure RelContainedInSpatialStructure(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcRelContainedInSpatialStructure is not supported in schema {_version}") + }; } public IIfcRelCoversBldgElements RelCoversBldgElements(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcRelCoversBldgElements is not supported in schema {_version}") + }; } public IIfcRelCoversSpaces RelCoversSpaces(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcRelCoversSpaces is not supported in schema {_version}") + }; } public IIfcRelDefinesByProperties RelDefinesByProperties(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcRelDefinesByProperties is not supported in schema {_version}") + }; } public IIfcRelDefinesByType RelDefinesByType(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcRelDefinesByType is not supported in schema {_version}") + }; } public IIfcRelFillsElement RelFillsElement(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcRelFillsElement is not supported in schema {_version}") + }; } public IIfcRelFlowControlElements RelFlowControlElements(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcRelFlowControlElements is not supported in schema {_version}") + }; } public IIfcRelNests RelNests(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcRelNests is not supported in schema {_version}") + }; } public IIfcRelProjectsElement RelProjectsElement(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcRelProjectsElement is not supported in schema {_version}") + }; } public IIfcRelReferencedInSpatialStructure RelReferencedInSpatialStructure(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcRelReferencedInSpatialStructure is not supported in schema {_version}") + }; } public IIfcRelSequence RelSequence(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcRelSequence is not supported in schema {_version}") + }; } public IIfcRelServicesBuildings RelServicesBuildings(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcRelServicesBuildings is not supported in schema {_version}") + }; } public IIfcRelSpaceBoundary RelSpaceBoundary(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcRelSpaceBoundary is not supported in schema {_version}") + }; } public IIfcRelVoidsElement RelVoidsElement(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcRelVoidsElement is not supported in schema {_version}") + }; } public IIfcRepresentationMap RepresentationMap(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcRepresentationMap is not supported in schema {_version}") + }; } public IIfcRevolvedAreaSolid RevolvedAreaSolid(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcRevolvedAreaSolid is not supported in schema {_version}") + }; } public IIfcRightCircularCone RightCircularCone(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcRightCircularCone is not supported in schema {_version}") + }; } public IIfcRightCircularCylinder RightCircularCylinder(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcRightCircularCylinder is not supported in schema {_version}") + }; } public IIfcRoof Roof(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcRoof is not supported in schema {_version}") + }; } public IIfcRoundedRectangleProfileDef RoundedRectangleProfileDef(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcRoundedRectangleProfileDef is not supported in schema {_version}") + }; } public IIfcSIUnit SIUnit(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcSIUnit is not supported in schema {_version}") + }; } public IIfcSanitaryTerminalType SanitaryTerminalType(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcSanitaryTerminalType is not supported in schema {_version}") + }; } public IIfcSectionProperties SectionProperties(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcSectionProperties is not supported in schema {_version}") + }; } public IIfcSectionReinforcementProperties SectionReinforcementProperties(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcSectionReinforcementProperties is not supported in schema {_version}") + }; } public IIfcSectionedSpine SectionedSpine(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcSectionedSpine is not supported in schema {_version}") + }; } public IIfcSensorType SensorType(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcSensorType is not supported in schema {_version}") + }; } public IIfcShapeAspect ShapeAspect(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcShapeAspect is not supported in schema {_version}") + }; } public IIfcShapeRepresentation ShapeRepresentation(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcShapeRepresentation is not supported in schema {_version}") + }; } public IIfcShellBasedSurfaceModel ShellBasedSurfaceModel(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcShellBasedSurfaceModel is not supported in schema {_version}") + }; } public IIfcSite Site(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcSite is not supported in schema {_version}") + }; } public IIfcSlab Slab(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcSlab is not supported in schema {_version}") + }; } public IIfcSlabType SlabType(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcSlabType is not supported in schema {_version}") + }; } public IIfcSlippageConnectionCondition SlippageConnectionCondition(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcSlippageConnectionCondition is not supported in schema {_version}") + }; } public IIfcSpace Space(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcSpace is not supported in schema {_version}") + }; } public IIfcSpaceHeaterType SpaceHeaterType(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcSpaceHeaterType is not supported in schema {_version}") + }; } public IIfcSpaceType SpaceType(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcSpaceType is not supported in schema {_version}") + }; } public IIfcSphere Sphere(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcSphere is not supported in schema {_version}") + }; } public IIfcStackTerminalType StackTerminalType(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcStackTerminalType is not supported in schema {_version}") + }; } public IIfcStair Stair(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcStair is not supported in schema {_version}") + }; } public IIfcStairFlight StairFlight(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcStairFlight is not supported in schema {_version}") + }; } public IIfcStairFlightType StairFlightType(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcStairFlightType is not supported in schema {_version}") + }; } public IIfcStructuralAnalysisModel StructuralAnalysisModel(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcStructuralAnalysisModel is not supported in schema {_version}") + }; } public IIfcStructuralCurveConnection StructuralCurveConnection(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcStructuralCurveConnection is not supported in schema {_version}") + }; } public IIfcStructuralCurveMember StructuralCurveMember(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcStructuralCurveMember is not supported in schema {_version}") + }; } public IIfcStructuralCurveMemberVarying StructuralCurveMemberVarying(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcStructuralCurveMemberVarying is not supported in schema {_version}") + }; } public IIfcStructuralLinearAction StructuralLinearAction(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcStructuralLinearAction is not supported in schema {_version}") + }; } public IIfcStructuralLoadGroup StructuralLoadGroup(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcStructuralLoadGroup is not supported in schema {_version}") + }; } public IIfcStructuralLoadLinearForce StructuralLoadLinearForce(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcStructuralLoadLinearForce is not supported in schema {_version}") + }; } public IIfcStructuralLoadPlanarForce StructuralLoadPlanarForce(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcStructuralLoadPlanarForce is not supported in schema {_version}") + }; } public IIfcStructuralLoadSingleDisplacement StructuralLoadSingleDisplacement(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcStructuralLoadSingleDisplacement is not supported in schema {_version}") + }; } public IIfcStructuralLoadSingleDisplacementDistortion StructuralLoadSingleDisplacementDistortion(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcStructuralLoadSingleDisplacementDistortion is not supported in schema {_version}") + }; } public IIfcStructuralLoadSingleForce StructuralLoadSingleForce(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcStructuralLoadSingleForce is not supported in schema {_version}") + }; } public IIfcStructuralLoadSingleForceWarping StructuralLoadSingleForceWarping(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcStructuralLoadSingleForceWarping is not supported in schema {_version}") + }; } public IIfcStructuralLoadTemperature StructuralLoadTemperature(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcStructuralLoadTemperature is not supported in schema {_version}") + }; } public IIfcStructuralPlanarAction StructuralPlanarAction(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcStructuralPlanarAction is not supported in schema {_version}") + }; } public IIfcStructuralPointAction StructuralPointAction(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcStructuralPointAction is not supported in schema {_version}") + }; } public IIfcStructuralPointConnection StructuralPointConnection(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcStructuralPointConnection is not supported in schema {_version}") + }; } public IIfcStructuralPointReaction StructuralPointReaction(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcStructuralPointReaction is not supported in schema {_version}") + }; } public IIfcStructuralResultGroup StructuralResultGroup(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcStructuralResultGroup is not supported in schema {_version}") + }; } public IIfcStructuralSurfaceConnection StructuralSurfaceConnection(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcStructuralSurfaceConnection is not supported in schema {_version}") + }; } public IIfcStructuralSurfaceMember StructuralSurfaceMember(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcStructuralSurfaceMember is not supported in schema {_version}") + }; } public IIfcStructuralSurfaceMemberVarying StructuralSurfaceMemberVarying(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcStructuralSurfaceMemberVarying is not supported in schema {_version}") + }; } public IIfcStyledItem StyledItem(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcStyledItem is not supported in schema {_version}") + }; } public IIfcStyledRepresentation StyledRepresentation(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcStyledRepresentation is not supported in schema {_version}") + }; } public IIfcSubContractResource SubContractResource(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcSubContractResource is not supported in schema {_version}") + }; } public IIfcSubedge Subedge(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcSubedge is not supported in schema {_version}") + }; } public IIfcSurfaceCurveSweptAreaSolid SurfaceCurveSweptAreaSolid(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcSurfaceCurveSweptAreaSolid is not supported in schema {_version}") + }; } public IIfcSurfaceOfLinearExtrusion SurfaceOfLinearExtrusion(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcSurfaceOfLinearExtrusion is not supported in schema {_version}") + }; } public IIfcSurfaceOfRevolution SurfaceOfRevolution(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcSurfaceOfRevolution is not supported in schema {_version}") + }; } public IIfcSurfaceStyle SurfaceStyle(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcSurfaceStyle is not supported in schema {_version}") + }; } public IIfcSurfaceStyleLighting SurfaceStyleLighting(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcSurfaceStyleLighting is not supported in schema {_version}") + }; } public IIfcSurfaceStyleRefraction SurfaceStyleRefraction(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcSurfaceStyleRefraction is not supported in schema {_version}") + }; } public IIfcSurfaceStyleRendering SurfaceStyleRendering(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcSurfaceStyleRendering is not supported in schema {_version}") + }; } public IIfcSurfaceStyleShading SurfaceStyleShading(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcSurfaceStyleShading is not supported in schema {_version}") + }; } public IIfcSurfaceStyleWithTextures SurfaceStyleWithTextures(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcSurfaceStyleWithTextures is not supported in schema {_version}") + }; } public IIfcSweptDiskSolid SweptDiskSolid(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcSweptDiskSolid is not supported in schema {_version}") + }; } public IIfcSwitchingDeviceType SwitchingDeviceType(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcSwitchingDeviceType is not supported in schema {_version}") + }; } public IIfcSystem System(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcSystem is not supported in schema {_version}") + }; } public IIfcSystemFurnitureElementType SystemFurnitureElementType(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcSystemFurnitureElementType is not supported in schema {_version}") + }; } public IIfcTShapeProfileDef TShapeProfileDef(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcTShapeProfileDef is not supported in schema {_version}") + }; } public IIfcTable Table(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcTable is not supported in schema {_version}") + }; } public IIfcTableRow TableRow(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcTableRow is not supported in schema {_version}") + }; } public IIfcTankType TankType(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcTankType is not supported in schema {_version}") + }; } public IIfcTask Task(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcTask is not supported in schema {_version}") + }; } public IIfcTelecomAddress TelecomAddress(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcTelecomAddress is not supported in schema {_version}") + }; } public IIfcTendon Tendon(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcTendon is not supported in schema {_version}") + }; } public IIfcTendonAnchor TendonAnchor(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcTendonAnchor is not supported in schema {_version}") + }; } public IIfcTextLiteral TextLiteral(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcTextLiteral is not supported in schema {_version}") + }; } public IIfcTextLiteralWithExtent TextLiteralWithExtent(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcTextLiteralWithExtent is not supported in schema {_version}") + }; } public IIfcTextStyle TextStyle(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcTextStyle is not supported in schema {_version}") + }; } public IIfcTextStyleFontModel TextStyleFontModel(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcTextStyleFontModel is not supported in schema {_version}") + }; } public IIfcTextStyleForDefinedFont TextStyleForDefinedFont(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcTextStyleForDefinedFont is not supported in schema {_version}") + }; } public IIfcTextStyleTextModel TextStyleTextModel(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcTextStyleTextModel is not supported in schema {_version}") + }; } public IIfcTextureCoordinateGenerator TextureCoordinateGenerator(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcTextureCoordinateGenerator is not supported in schema {_version}") + }; } public IIfcTextureMap TextureMap(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcTextureMap is not supported in schema {_version}") + }; } public IIfcTextureVertex TextureVertex(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcTextureVertex is not supported in schema {_version}") + }; } public IIfcTimeSeriesValue TimeSeriesValue(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcTimeSeriesValue is not supported in schema {_version}") + }; } public IIfcTopologyRepresentation TopologyRepresentation(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcTopologyRepresentation is not supported in schema {_version}") + }; } public IIfcTransformerType TransformerType(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcTransformerType is not supported in schema {_version}") + }; } public IIfcTransportElement TransportElement(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcTransportElement is not supported in schema {_version}") + }; } public IIfcTransportElementType TransportElementType(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcTransportElementType is not supported in schema {_version}") + }; } public IIfcTrapeziumProfileDef TrapeziumProfileDef(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcTrapeziumProfileDef is not supported in schema {_version}") + }; } public IIfcTrimmedCurve TrimmedCurve(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcTrimmedCurve is not supported in schema {_version}") + }; } public IIfcTubeBundleType TubeBundleType(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcTubeBundleType is not supported in schema {_version}") + }; } public IIfcTypeObject TypeObject(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcTypeObject is not supported in schema {_version}") + }; } public IIfcTypeProduct TypeProduct(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcTypeProduct is not supported in schema {_version}") + }; } public IIfcUShapeProfileDef UShapeProfileDef(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcUShapeProfileDef is not supported in schema {_version}") + }; } public IIfcUnitAssignment UnitAssignment(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcUnitAssignment is not supported in schema {_version}") + }; } public IIfcUnitaryEquipmentType UnitaryEquipmentType(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcUnitaryEquipmentType is not supported in schema {_version}") + }; } public IIfcValveType ValveType(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcValveType is not supported in schema {_version}") + }; } public IIfcVector Vector(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcVector is not supported in schema {_version}") + }; } public IIfcVertex Vertex(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcVertex is not supported in schema {_version}") + }; } public IIfcVertexLoop VertexLoop(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcVertexLoop is not supported in schema {_version}") + }; } public IIfcVertexPoint VertexPoint(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcVertexPoint is not supported in schema {_version}") + }; } public IIfcVibrationIsolatorType VibrationIsolatorType(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcVibrationIsolatorType is not supported in schema {_version}") + }; } public IIfcVirtualElement VirtualElement(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcVirtualElement is not supported in schema {_version}") + }; } public IIfcVirtualGridIntersection VirtualGridIntersection(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcVirtualGridIntersection is not supported in schema {_version}") + }; } public IIfcWall Wall(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcWall is not supported in schema {_version}") + }; } public IIfcWallStandardCase WallStandardCase(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcWallStandardCase is not supported in schema {_version}") + }; } public IIfcWallType WallType(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcWallType is not supported in schema {_version}") + }; } public IIfcWasteTerminalType WasteTerminalType(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcWasteTerminalType is not supported in schema {_version}") + }; } public IIfcWindow Window(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcWindow is not supported in schema {_version}") + }; } public IIfcWindowLiningProperties WindowLiningProperties(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcWindowLiningProperties is not supported in schema {_version}") + }; } public IIfcWindowPanelProperties WindowPanelProperties(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); - } - - public IIfcWindowStyle WindowStyle(Action init = null) - { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcWindowPanelProperties is not supported in schema {_version}") + }; } public IIfcWorkPlan WorkPlan(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcWorkPlan is not supported in schema {_version}") + }; } public IIfcWorkSchedule WorkSchedule(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcWorkSchedule is not supported in schema {_version}") + }; } public IIfcZShapeProfileDef ZShapeProfileDef(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcZShapeProfileDef is not supported in schema {_version}") + }; } public IIfcZone Zone(Action init = null) { - if (_version == XbimSchemaVersion.Ifc4) - return _model.Instances.New(init); - return _model.Instances.New(init); + return _version switch + { + XbimSchemaVersion.Ifc2X3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4x3 => _model.Instances.New(init), + XbimSchemaVersion.Ifc4 => _model.Instances.New(init), + _ => throw new NotSupportedException($"Type IfcZone is not supported in schema {_version}") + }; } - public void Dispose() - { - } } } \ No newline at end of file