From 9fa81bd44dcd80c3e5c6aa4031015e5ce1698e31 Mon Sep 17 00:00:00 2001 From: Ihor Vasyliev Date: Thu, 7 Aug 2025 19:48:00 -0700 Subject: [PATCH 1/2] REVIT-238303: Update 2x3 quantity list --- .../RevitIFCTools/GeneratePsetDefWin.xaml.cs | 5 +- Source/RevitIFCTools/ProcessPsetDefinition.cs | 451 +++++------------- 2 files changed, 121 insertions(+), 335 deletions(-) diff --git a/Source/RevitIFCTools/GeneratePsetDefWin.xaml.cs b/Source/RevitIFCTools/GeneratePsetDefWin.xaml.cs index b33c79c2..112221c7 100644 --- a/Source/RevitIFCTools/GeneratePsetDefWin.xaml.cs +++ b/Source/RevitIFCTools/GeneratePsetDefWin.xaml.cs @@ -79,6 +79,10 @@ private void button_Go_Click(object sender, RoutedEventArgs e) logF = new StreamWriter(Path.Combine(tempFolder, "GeneratePsetDefWin.log")); textBox_OutputMsg.Clear(); + outputFilename = textBox_OutputFile.Text; + SharedParFileName = textBox_SharedParFile.Text; + SharedParFileNameType = textBox_ShParFileType.Text; + string parFileNameOut = Path.Combine(Path.GetDirectoryName(SharedParFileName), Path.GetFileNameWithoutExtension(SharedParFileName) + "_out.txt"); stSharedPar = File.CreateText(parFileNameOut); IDictionary existingParDict = ProcessPsetDefinition.processExistingParFile(SharedParFileName); @@ -569,7 +573,6 @@ int WriteGeneratedCode(StreamWriter outF, ProcessPsetDefinition procPsetDef, str if (!string.IsNullOrEmpty(vspecPDef.PropertySetDef.PredefinedType)) outF.WriteLine(" {0}.PredefinedType = \"{1}\";", varName, vspecPDef.PropertySetDef.PredefinedType); } - //} // Process each property foreach (PsetProperty prop in pDef.properties) diff --git a/Source/RevitIFCTools/ProcessPsetDefinition.cs b/Source/RevitIFCTools/ProcessPsetDefinition.cs index d170a957..71075439 100644 --- a/Source/RevitIFCTools/ProcessPsetDefinition.cs +++ b/Source/RevitIFCTools/ProcessPsetDefinition.cs @@ -1163,26 +1163,12 @@ public void Process2x3QtoSets(string schemaName) AddPsetDefToDict(schemaName, Qto_BeamBaseQuantitiesIFC2x3(schemaName)); AddPsetDefToDict(schemaName, Qto_ColumnBaseQuantitiesIFC2x3(schemaName)); AddPsetDefToDict(schemaName, Qto_MemberBaseQuantitiesIFC2x3(schemaName)); - AddPsetDefToDict(schemaName, Qto_PileBaseQuantitiesIFC2x3(schemaName)); - AddPsetDefToDict(schemaName, Qto_PlateBaseQuantitiesIFC2x3(schemaName)); AddPsetDefToDict(schemaName, Qto_CoveringBaseQuantitiesIFC2x3(schemaName)); - AddPsetDefToDict(schemaName, Qto_CurtainWallQuantitiesIFC2x3(schemaName)); - AddPsetDefToDict(schemaName, Qto_DoorBaseQuantitiesIFC2x3(schemaName)); AddPsetDefToDict(schemaName, Qto_OpeningElementBaseQuantitiesIFC2x3(schemaName)); - AddPsetDefToDict(schemaName, Qto_RailingBaseQuantitiesIFC2x3(schemaName)); - AddPsetDefToDict(schemaName, Qto_RampFlightBaseQuantitiesIFC2x3(schemaName)); + AddPsetDefToDict(schemaName, Qto_ProjectionElementBaseQuantitiesIFC2x3(schemaName)); AddPsetDefToDict(schemaName, Qto_SlabBaseQuantitiesIFC2x3(schemaName)); AddPsetDefToDict(schemaName, Qto_RoofBaseQuantitiesIFC2x3(schemaName)); - AddPsetDefToDict(schemaName, Qto_StairFlightBaseQuantitiesIFC2x3(schemaName)); AddPsetDefToDict(schemaName, Qto_WallBaseQuantitiesIFC2x3(schemaName)); - AddPsetDefToDict(schemaName, Qto_WindowBaseQuantitiesIFC2x3(schemaName)); - - // MEP - AddPsetDefToDict(schemaName, Qto_DuctFittingBaseQuantitiesIFC2x3(schemaName)); - AddPsetDefToDict(schemaName, Qto_ElectricApplianceBaseQuantitiesIFC2x3(schemaName)); - AddPsetDefToDict(schemaName, Qto_CableCarrierFittingBaseQuantitiesIFC2x3(schemaName)); - AddPsetDefToDict(schemaName, Qto_CableCarrierSegmentBaseQuantitiesIFC2x3(schemaName)); - AddPsetDefToDict(schemaName, Qto_CableSegmentBaseQuantitiesIFC2x3(schemaName)); } } @@ -1196,13 +1182,13 @@ private PsetDefinition Qto_SiteBaseQuantitiesIFC2x3(string schemaName) psetD.properties.Add(new PsetProperty() { - Name = "GrossPerimeter", + Name = "NominalPerimeter", PropertyType = new PropertySingleValue() { DataType = "IfcPositiveLengthMeasure" } }); psetD.properties.Add(new PsetProperty() { - Name = "GrossArea", + Name = "NominalArea", PropertyType = new PropertySingleValue() { DataType = "IfcAreaMeasure" } }); @@ -1219,16 +1205,40 @@ private PsetDefinition Qto_BuildingBaseQuantitiesIFC2x3(string schemaName) psetD.properties.Add(new PsetProperty() { - Name = "Height", + Name = "NominalHeight", PropertyType = new PropertySingleValue() { DataType = "IfcPositiveLengthMeasure" } }); + psetD.properties.Add(new PsetProperty() + { + Name = "NominalArea", + PropertyType = new PropertySingleValue() { DataType = "IfcAreaMeasure" } + }); + psetD.properties.Add(new PsetProperty() { Name = "GrossFloorArea", PropertyType = new PropertySingleValue() { DataType = "IfcAreaMeasure" } }); + psetD.properties.Add(new PsetProperty() + { + Name = "NetFloorArea", + PropertyType = new PropertySingleValue() { DataType = "IfcAreaMeasure" } + }); + + psetD.properties.Add(new PsetProperty() + { + Name = "GrossVolume", + PropertyType = new PropertySingleValue() { DataType = "IfcVolumeMeasure" } + }); + + psetD.properties.Add(new PsetProperty() + { + Name = "NetVolume", + PropertyType = new PropertySingleValue() { DataType = "IfcVolumeMeasure" } + }); + return psetD; } @@ -1242,33 +1252,32 @@ private PsetDefinition Qto_BuildingStoreyBaseQuantitiesIFC2x3(string schemaName) psetD.properties.Add(new PsetProperty() { - Name = "GrossHeight", + Name = "NominalHeight", PropertyType = new PropertySingleValue() { DataType = "IfcPositiveLengthMeasure" } }); psetD.properties.Add(new PsetProperty() { - Name = "NetHeight", - PropertyType = new PropertySingleValue() { DataType = "IfcPositiveLengthMeasure" } + Name = "GrossFloorArea", + PropertyType = new PropertySingleValue() { DataType = "IfcAreaMeasure" } }); - // 3 Quantities below are required by COBie psetD.properties.Add(new PsetProperty() { - Name = "GrossPerimeter", - PropertyType = new PropertySingleValue() { DataType = "IfcPositiveLengthMeasure" } + Name = "NetFloorArea", + PropertyType = new PropertySingleValue() { DataType = "IfcAreaMeasure" } }); psetD.properties.Add(new PsetProperty() { - Name = "GrossFloorArea", - PropertyType = new PropertySingleValue() { DataType = "IfcAreaMeasure" } + Name = "GrossVolume", + PropertyType = new PropertySingleValue() { DataType = "IfcVolumeMeasure" } }); psetD.properties.Add(new PsetProperty() { - Name = "NetFloorArea", - PropertyType = new PropertySingleValue() { DataType = "IfcAreaMeasure" } + Name = "NetVolume", + PropertyType = new PropertySingleValue() { DataType = "IfcVolumeMeasure" } }); return psetD; @@ -1284,62 +1293,62 @@ private PsetDefinition Qto_SpaceBaseQuantitiesIFC2x3(string schemaName) psetD.properties.Add(new PsetProperty() { - Name = "GrossFloorArea", - PropertyType = new PropertySingleValue() { DataType = "IfcAreaMeasure" } + Name = "NominalHeight", + PropertyType = new PropertySingleValue() { DataType = "IfcPositiveLengthMeasure" } }); psetD.properties.Add(new PsetProperty() { - Name = "NetFloorArea", - PropertyType = new PropertySingleValue() { DataType = "IfcAreaMeasure" } + Name = "ClearHeight", + PropertyType = new PropertySingleValue() { DataType = "IfcPositiveLengthMeasure" } }); psetD.properties.Add(new PsetProperty() { - Name = "NetCeilingArea", - PropertyType = new PropertySingleValue() { DataType = "IfcAreaMeasure" } + Name = "GrossPerimeter", + PropertyType = new PropertySingleValue() { DataType = "IfcPositiveLengthMeasure" } }); psetD.properties.Add(new PsetProperty() { - Name = "GrossCeilingArea", - PropertyType = new PropertySingleValue() { DataType = "IfcAreaMeasure" } + Name = "NetPerimeter", + PropertyType = new PropertySingleValue() { DataType = "IfcPositiveLengthMeasure" } }); psetD.properties.Add(new PsetProperty() { - Name = "NetWallArea", + Name = "GrossFloorArea", PropertyType = new PropertySingleValue() { DataType = "IfcAreaMeasure" } }); psetD.properties.Add(new PsetProperty() { - Name = "GrossWallArea", + Name = "NetFloorArea", PropertyType = new PropertySingleValue() { DataType = "IfcAreaMeasure" } }); psetD.properties.Add(new PsetProperty() { - Name = "FinishCeilingHeight", - PropertyType = new PropertySingleValue() { DataType = "IfcPositiveLengthMeasure" } + Name = "GrossCeilingArea", + PropertyType = new PropertySingleValue() { DataType = "IfcAreaMeasure" } }); psetD.properties.Add(new PsetProperty() { - Name = "Height", - PropertyType = new PropertySingleValue() { DataType = "IfcPositiveLengthMeasure" } + Name = "NetCeilingArea", + PropertyType = new PropertySingleValue() { DataType = "IfcAreaMeasure" } }); psetD.properties.Add(new PsetProperty() { - Name = "NetPerimeter", - PropertyType = new PropertySingleValue() { DataType = "IfcPositiveLengthMeasure" } + Name = "GrossWallArea", + PropertyType = new PropertySingleValue() { DataType = "IfcAreaMeasure" } }); psetD.properties.Add(new PsetProperty() { - Name = "GrossPerimeter", - PropertyType = new PropertySingleValue() { DataType = "IfcPositiveLengthMeasure" } + Name = "NetWallArea", + PropertyType = new PropertySingleValue() { DataType = "IfcAreaMeasure" } }); psetD.properties.Add(new PsetProperty() @@ -1350,8 +1359,8 @@ private PsetDefinition Qto_SpaceBaseQuantitiesIFC2x3(string schemaName) psetD.properties.Add(new PsetProperty() { - Name = "FinishFloorHeight", - PropertyType = new PropertySingleValue() { DataType = "IfcPositiveLengthMeasure" } + Name = "NetVolume", + PropertyType = new PropertySingleValue() { DataType = "IfcVolumeMeasure" } }); return psetD; @@ -1367,33 +1376,15 @@ private PsetDefinition Qto_CoveringBaseQuantitiesIFC2x3(string schemaName) psetD.properties.Add(new PsetProperty() { - Name = "GrossCeilingArea", + Name = "GrossArea", PropertyType = new PropertySingleValue() { DataType = "IfcAreaMeasure" } }); - return psetD; - } - - private PsetDefinition Qto_DoorBaseQuantitiesIFC2x3(string schemaName) - { - PsetDefinition psetD = new PsetDefinition(); - psetD.Name = "Qto_DoorBaseQuantities"; - psetD.IfcVersion = schemaName; - psetD.ApplicableClasses = new List() { "IfcDoor" }; - psetD.properties = new HashSet(); - AddQuantitiesForDoorOrWindow(ref psetD); - - return psetD; - } - - private PsetDefinition Qto_WindowBaseQuantitiesIFC2x3(string schemaName) - { - PsetDefinition psetD = new PsetDefinition(); - psetD.Name = "Qto_WindowBaseQuantities"; - psetD.IfcVersion = schemaName; - psetD.ApplicableClasses = new List() { "IfcWindow" }; - psetD.properties = new HashSet(); - AddQuantitiesForDoorOrWindow(ref psetD); + psetD.properties.Add(new PsetProperty() + { + Name = "NetArea", + PropertyType = new PropertySingleValue() { DataType = "IfcAreaMeasure" } + }); return psetD; } @@ -1423,19 +1414,7 @@ private void AddQuantitiesForStructuralElement(ref PsetDefinition psetD) { psetD.properties.Add(new PsetProperty() { - Name = "Length", - PropertyType = new PropertySingleValue() { DataType = "IfcPositiveLengthMeasure" } - }); - - psetD.properties.Add(new PsetProperty() - { - Name = "Height", - PropertyType = new PropertySingleValue() { DataType = "IfcPositiveLengthMeasure" } - }); - - psetD.properties.Add(new PsetProperty() - { - Name = "Width", + Name = "NominalLength", PropertyType = new PropertySingleValue() { DataType = "IfcPositiveLengthMeasure" } }); @@ -1453,7 +1432,7 @@ private void AddQuantitiesForStructuralElement(ref PsetDefinition psetD) psetD.properties.Add(new PsetProperty() { - Name = "GrossSurfaceArea", + Name = "TotalSurfaceArea", PropertyType = new PropertySingleValue() { DataType = "IfcAreaMeasure" } }); @@ -1468,6 +1447,18 @@ private void AddQuantitiesForStructuralElement(ref PsetDefinition psetD) Name = "NetVolume", PropertyType = new PropertySingleValue() { DataType = "IfcVolumeMeasure" } }); + + psetD.properties.Add(new PsetProperty() + { + Name = "GrossWeight", + PropertyType = new PropertySingleValue() { DataType = "IfcMassMeasure" } + }); + + psetD.properties.Add(new PsetProperty() + { + Name = "NetWeight", + PropertyType = new PropertySingleValue() { DataType = "IfcMassMeasure" } + }); } private PsetDefinition Qto_BeamBaseQuantitiesIFC2x3(string schemaName) @@ -1506,191 +1497,123 @@ private PsetDefinition Qto_MemberBaseQuantitiesIFC2x3(string schemaName) return psetD; } - private PsetDefinition Qto_PileBaseQuantitiesIFC2x3(string schemaName) - { - PsetDefinition psetD = new PsetDefinition(); - psetD.Name = "Qto_PileBaseQuantities"; - psetD.IfcVersion = schemaName; - psetD.ApplicableClasses = new List() { "IfcPile" }; - psetD.properties = new HashSet(); - AddQuantitiesForStructuralElement(ref psetD); - - return psetD; - } - - private PsetDefinition Qto_PlateBaseQuantitiesIFC2x3(string schemaName) + private PsetDefinition Qto_OpeningElementBaseQuantitiesIFC2x3(string schemaName) { PsetDefinition psetD = new PsetDefinition(); - psetD.Name = "Qto_PlateBaseQuantities"; + psetD.Name = "Qto_OpeningElementBaseQuantities"; psetD.IfcVersion = schemaName; - psetD.ApplicableClasses = new List() { "IfcPlate" }; + psetD.ApplicableClasses = new List() { "IfcOpeningElement" }; psetD.properties = new HashSet(); psetD.properties.Add(new PsetProperty() { - Name = "GrossVolume", - PropertyType = new PropertySingleValue() { DataType = "IfcVolumeMeasure" } + Name = "NominalArea", + PropertyType = new PropertySingleValue() { DataType = "IfcAreaMeasure" } }); psetD.properties.Add(new PsetProperty() { - Name = "NetVolume", + Name = "NominalVolume", PropertyType = new PropertySingleValue() { DataType = "IfcVolumeMeasure" } }); return psetD; } - private PsetDefinition Qto_CurtainWallQuantitiesIFC2x3(string schemaName) + private PsetDefinition Qto_ProjectionElementBaseQuantitiesIFC2x3(string schemaName) { PsetDefinition psetD = new PsetDefinition(); - psetD.Name = "Qto_CurtainWallQuantities"; + psetD.Name = "Qto_ProjectionElementBaseQuantities"; psetD.IfcVersion = schemaName; - psetD.ApplicableClasses = new List() { "IfcCurtainWall" }; + psetD.ApplicableClasses = new List() { "IfcProjectionElement" }; psetD.properties = new HashSet(); psetD.properties.Add(new PsetProperty() { - Name = "Width", - PropertyType = new PropertySingleValue() { DataType = "IfcPositiveLengthMeasure" } - }); - - psetD.properties.Add(new PsetProperty() - { - Name = "Height", - PropertyType = new PropertySingleValue() { DataType = "IfcPositiveLengthMeasure" } + Name = "NominalArea", + PropertyType = new PropertySingleValue() { DataType = "IfcAreaMeasure" } }); psetD.properties.Add(new PsetProperty() { - Name = "GrossSideArea", - PropertyType = new PropertySingleValue() { DataType = "IfcAreaMeasure" } + Name = "NominalVolume", + PropertyType = new PropertySingleValue() { DataType = "IfcVolumeMeasure" } }); return psetD; } - private PsetDefinition Qto_OpeningElementBaseQuantitiesIFC2x3(string schemaName) + private PsetDefinition Qto_WallBaseQuantitiesIFC2x3(string schemaName) { PsetDefinition psetD = new PsetDefinition(); - psetD.Name = "Qto_OpeningElementBaseQuantities"; + psetD.Name = "Qto_WallBaseQuantities"; psetD.IfcVersion = schemaName; - psetD.ApplicableClasses = new List() { "IfcOpeningElement" }; + psetD.ApplicableClasses = new List() { "IfcWall", "IfcWallStandardCase" }; psetD.properties = new HashSet(); psetD.properties.Add(new PsetProperty() { - Name = "Width", + Name = "NominalLength", PropertyType = new PropertySingleValue() { DataType = "IfcPositiveLengthMeasure" } }); psetD.properties.Add(new PsetProperty() { - Name = "Height", + Name = "NominalWidth", PropertyType = new PropertySingleValue() { DataType = "IfcPositiveLengthMeasure" } }); psetD.properties.Add(new PsetProperty() { - Name = "Area", - PropertyType = new PropertySingleValue() { DataType = "IfcAreaMeasure" } - }); - - psetD.properties.Add(new PsetProperty() - { - Name = "Volume", - PropertyType = new PropertySingleValue() { DataType = "IfcVolumeMeasure" } + Name = "NominalHeight", + PropertyType = new PropertySingleValue() { DataType = "IfcPositiveLengthMeasure" } }); - return psetD; - } - - private PsetDefinition Qto_RailingBaseQuantitiesIFC2x3(string schemaName) - { - PsetDefinition psetD = new PsetDefinition(); - psetD.Name = "Qto_RailingBaseQuantities"; - psetD.IfcVersion = schemaName; - psetD.ApplicableClasses = new List() { "IfcRailing" }; - psetD.properties = new HashSet(); - psetD.properties.Add(new PsetProperty() { - Name = "Length", - PropertyType = new PropertySingleValue() { DataType = "IfcPositiveLengthMeasure" } + Name = "GrossFootprintArea", + PropertyType = new PropertySingleValue() { DataType = "IfcAreaMeasure" } }); - return psetD; - } - - private PsetDefinition Qto_RampFlightBaseQuantitiesIFC2x3(string schemaName) - { - PsetDefinition psetD = new PsetDefinition(); - psetD.Name = "Qto_RampFlightBaseQuantities"; - psetD.IfcVersion = schemaName; - psetD.ApplicableClasses = new List() { "IfcRampFlight" }; - psetD.properties = new HashSet(); - psetD.properties.Add(new PsetProperty() { - Name = "Width", - PropertyType = new PropertySingleValue() { DataType = "IfcPositiveLengthMeasure" } + Name = "NetFootprintArea", + PropertyType = new PropertySingleValue() { DataType = "IfcAreaMeasure" } }); - return psetD; - } - - private PsetDefinition Qto_StairFlightBaseQuantitiesIFC2x3(string schemaName) - { - PsetDefinition psetD = new PsetDefinition(); - psetD.Name = "Qto_StairFlightBaseQuantities"; - psetD.IfcVersion = schemaName; - psetD.ApplicableClasses = new List() { "IfcStairFlight" }; - psetD.properties = new HashSet(); - psetD.properties.Add(new PsetProperty() { - Name = "Length", - PropertyType = new PropertySingleValue() { DataType = "IfcPositiveLengthMeasure" } + Name = "GrossSideArea", + PropertyType = new PropertySingleValue() { DataType = "IfcAreaMeasure" } }); - return psetD; - } - - private PsetDefinition Qto_WallBaseQuantitiesIFC2x3(string schemaName) - { - PsetDefinition psetD = new PsetDefinition(); - psetD.Name = "Qto_WallBaseQuantities"; - psetD.IfcVersion = schemaName; - psetD.ApplicableClasses = new List() { "IfcWall", "IfcWallStandardCase" }; - psetD.properties = new HashSet(); - psetD.properties.Add(new PsetProperty() { - Name = "Length", - PropertyType = new PropertySingleValue() { DataType = "IfcPositiveLengthMeasure" } + Name = "NetSideArea", + PropertyType = new PropertySingleValue() { DataType = "IfcAreaMeasure" } }); psetD.properties.Add(new PsetProperty() { - Name = "Width", - PropertyType = new PropertySingleValue() { DataType = "IfcPositiveLengthMeasure" } + Name = "GrossSideAreaLeft", + PropertyType = new PropertySingleValue() { DataType = "IfcAreaMeasure" } }); psetD.properties.Add(new PsetProperty() { - Name = "Height", - PropertyType = new PropertySingleValue() { DataType = "IfcPositiveLengthMeasure" } + Name = "NetSideAreaLeft", + PropertyType = new PropertySingleValue() { DataType = "IfcAreaMeasure" } }); psetD.properties.Add(new PsetProperty() { - Name = "GrossSideArea", + Name = "GrossSideAreaRight", PropertyType = new PropertySingleValue() { DataType = "IfcAreaMeasure" } }); psetD.properties.Add(new PsetProperty() { - Name = "NetSideArea", + Name = "NetSideAreaRight", PropertyType = new PropertySingleValue() { DataType = "IfcAreaMeasure" } }); @@ -1719,7 +1642,7 @@ private PsetDefinition Qto_SlabBaseQuantitiesIFC2x3(string schemaName) psetD.properties.Add(new PsetProperty() { - Name = "Width", + Name = "NominalWidth", PropertyType = new PropertySingleValue() { DataType = "IfcPositiveLengthMeasure" } }); @@ -1753,178 +1676,38 @@ private PsetDefinition Qto_SlabBaseQuantitiesIFC2x3(string schemaName) PropertyType = new PropertySingleValue() { DataType = "IfcVolumeMeasure" } }); - return psetD; - } - - private PsetDefinition Qto_RoofBaseQuantitiesIFC2x3(string schemaName) - { - PsetDefinition psetD = new PsetDefinition(); - psetD.Name = "Qto_RoofBaseQuantities"; - psetD.IfcVersion = schemaName; - psetD.ApplicableClasses = new List() { "IfcRoof" }; - psetD.properties = new HashSet(); - - psetD.properties.Add(new PsetProperty() - { - Name = "GrossArea", - PropertyType = new PropertySingleValue() { DataType = "IfcAreaMeasure" } - }); - - psetD.properties.Add(new PsetProperty() - { - Name = "NetArea", - PropertyType = new PropertySingleValue() { DataType = "IfcAreaMeasure" } - }); - - return psetD; - } - - private PsetDefinition Qto_DuctFittingBaseQuantitiesIFC2x3(string schemaName) - { - PsetDefinition psetD = new PsetDefinition(); - psetD.Name = "Qto_DuctFittingBaseQuantities"; - psetD.IfcVersion = schemaName; - psetD.ApplicableClasses = new List() { "IfcDuctFitting" }; - psetD.properties = new HashSet(); - - psetD.properties.Add(new PsetProperty() - { - Name = "Length", - PropertyType = new PropertySingleValue() { DataType = "IfcPositiveLengthMeasure" } - }); - - psetD.properties.Add(new PsetProperty() - { - Name = "GrossCrossSectionArea", - PropertyType = new PropertySingleValue() { DataType = "IfcAreaMeasure" } - }); - - psetD.properties.Add(new PsetProperty() - { - Name = "NetCrossSectionArea", - PropertyType = new PropertySingleValue() { DataType = "IfcAreaMeasure" } - }); - - psetD.properties.Add(new PsetProperty() - { - Name = "OuterSurfaceArea", - PropertyType = new PropertySingleValue() { DataType = "IfcAreaMeasure" } - }); - - psetD.properties.Add(new PsetProperty() - { - Name = "GrossWeight", - PropertyType = new PropertySingleValue() { DataType = "IfcMassMeasure" } - }); - - return psetD; - } - - private PsetDefinition Qto_ElectricApplianceBaseQuantitiesIFC2x3(string schemaName) - { - PsetDefinition psetD = new PsetDefinition(); - psetD.Name = "Qto_ElectricApplianceBaseQuantities"; - psetD.IfcVersion = schemaName; - psetD.ApplicableClasses = new List() { "IfcElectricAppliance" }; - psetD.properties = new HashSet(); - psetD.properties.Add(new PsetProperty() { Name = "GrossWeight", PropertyType = new PropertySingleValue() { DataType = "IfcMassMeasure" } }); - return psetD; - } - - private PsetDefinition Qto_CableCarrierFittingBaseQuantitiesIFC2x3(string schemaName) - { - PsetDefinition psetD = new PsetDefinition(); - psetD.Name = "Qto_CableCarrierFittingBaseQuantities"; - psetD.IfcVersion = schemaName; - psetD.ApplicableClasses = new List() { "IfcCableCarrierFitting" }; - psetD.properties = new HashSet(); - psetD.properties.Add(new PsetProperty() { - Name = "GrossWeight", + Name = "NetWeight", PropertyType = new PropertySingleValue() { DataType = "IfcMassMeasure" } }); return psetD; } - private PsetDefinition Qto_CableCarrierSegmentBaseQuantitiesIFC2x3(string schemaName) - { - PsetDefinition psetD = new PsetDefinition(); - psetD.Name = "Qto_CableCarrierSegmentBaseQuantities"; - psetD.IfcVersion = schemaName; - psetD.ApplicableClasses = new List() { "IfcCableCarrierSegment" }; - psetD.properties = new HashSet(); - - psetD.properties.Add(new PsetProperty() - { - Name = "Length", - PropertyType = new PropertySingleValue() { DataType = "IfcPositiveLengthMeasure" } - }); - - psetD.properties.Add(new PsetProperty() - { - Name = "CrossSectionArea", - PropertyType = new PropertySingleValue() { DataType = "IfcAreaMeasure" } - }); - - psetD.properties.Add(new PsetProperty() - { - Name = "OuterSurfaceArea", - PropertyType = new PropertySingleValue() { DataType = "IfcAreaMeasure" } - }); - - psetD.properties.Add(new PsetProperty() - { - Name = "GrossWeight", - PropertyType = new PropertySingleValue() { DataType = "IfcMassMeasure" } - }); - - return psetD; - } - - private PsetDefinition Qto_CableSegmentBaseQuantitiesIFC2x3(string schemaName) + private PsetDefinition Qto_RoofBaseQuantitiesIFC2x3(string schemaName) { PsetDefinition psetD = new PsetDefinition(); - psetD.Name = "Qto_CableSegmentBaseQuantities"; + psetD.Name = "Qto_RoofBaseQuantities"; psetD.IfcVersion = schemaName; - psetD.ApplicableClasses = new List() { "IfcCableSegment" }; + psetD.ApplicableClasses = new List() { "IfcRoof" }; psetD.properties = new HashSet(); psetD.properties.Add(new PsetProperty() { - Name = "Length", - PropertyType = new PropertySingleValue() { DataType = "IfcPositiveLengthMeasure" } - }); - - psetD.properties.Add(new PsetProperty() - { - Name = "CrossSectionArea", + Name = "TotalSurfaceArea", PropertyType = new PropertySingleValue() { DataType = "IfcAreaMeasure" } }); - psetD.properties.Add(new PsetProperty() - { - Name = "OuterSurfaceArea", - PropertyType = new PropertySingleValue() { DataType = "IfcAreaMeasure" } - }); - - psetD.properties.Add(new PsetProperty() - { - Name = "GrossWeight", - PropertyType = new PropertySingleValue() { DataType = "IfcMassMeasure" } - }); - return psetD; } - public void ProcessPredefinedPsets(string schemaName) { AddPsetDefToDict(schemaName, IfcDoorLiningProperties(schemaName)); From 6343eada478330600c39f156b745b631aeee90b3 Mon Sep 17 00:00:00 2001 From: Ihor Vasyliev Date: Wed, 13 Aug 2025 05:35:05 -0700 Subject: [PATCH 2/2] REVIT-240286: Update 2x2 quantity list --- .../RevitIFCTools/GeneratePsetDefWin.xaml.cs | 4 +- Source/RevitIFCTools/IFCEntityListWin.xaml.cs | 4 +- Source/RevitIFCTools/ProcessPsetDefinition.cs | 388 ++++++++++++++++-- 3 files changed, 368 insertions(+), 28 deletions(-) diff --git a/Source/RevitIFCTools/GeneratePsetDefWin.xaml.cs b/Source/RevitIFCTools/GeneratePsetDefWin.xaml.cs index 112221c7..660940eb 100644 --- a/Source/RevitIFCTools/GeneratePsetDefWin.xaml.cs +++ b/Source/RevitIFCTools/GeneratePsetDefWin.xaml.cs @@ -142,10 +142,10 @@ private void button_Go_Click(object sender, RoutedEventArgs e) procPsetDef.ProcessSchemaPsetDef(schemaFolder, qto, keywordsToProcess); } - // Process IFC2x3 QTO properties + // Process IFC2x2/IFC2x3 QTO properties foreach (string schemaName in IfcSchemaProcessed) { - procPsetDef.Process2x3QtoSets(schemaName); + procPsetDef.ProcessPreIfc4QtoSets(schemaName); } // Process predefined properties diff --git a/Source/RevitIFCTools/IFCEntityListWin.xaml.cs b/Source/RevitIFCTools/IFCEntityListWin.xaml.cs index 3a7f1216..8fc68f46 100644 --- a/Source/RevitIFCTools/IFCEntityListWin.xaml.cs +++ b/Source/RevitIFCTools/IFCEntityListWin.xaml.cs @@ -184,8 +184,8 @@ private void button_Go_Click(object sender, RoutedEventArgs e) } } - // Process IFC2x3 QTO properties - procPdef.Process2x3QtoSets(schemaName); + // Process IFC2x2/IFC2x3 QTO properties + procPdef.ProcessPreIfc4QtoSets(schemaName); procPdef.ProcessPredefinedPsets(schemaName); diff --git a/Source/RevitIFCTools/ProcessPsetDefinition.cs b/Source/RevitIFCTools/ProcessPsetDefinition.cs index 71075439..42632572 100644 --- a/Source/RevitIFCTools/ProcessPsetDefinition.cs +++ b/Source/RevitIFCTools/ProcessPsetDefinition.cs @@ -1151,10 +1151,26 @@ public void ProcessSchemaPsetDef(string schemaName, DirectoryInfo psdFolder, Dic } } - public void Process2x3QtoSets(string schemaName) + public void ProcessPreIfc4QtoSets(string schemaName) { - // This is only for IFC2x3 which does not have the formal QTO set definitions in the official documentation - if (schemaName.StartsWith("IFC2X3", StringComparison.InvariantCultureIgnoreCase)) + // The QTO set definitions are taken from the web documentation + // because they are not represented in the official schema files for IFC2x2 and IFC2x3. + if (schemaName.StartsWith("IFC2X2", StringComparison.InvariantCultureIgnoreCase)) + { + AddPsetDefToDict(schemaName, Qto_SiteBaseQuantitiesIFC2x2(schemaName)); + AddPsetDefToDict(schemaName, Qto_BuildingBaseQuantitiesIFC2x2(schemaName)); + AddPsetDefToDict(schemaName, Qto_BuildingStoreyBaseQuantitiesIFC2x2(schemaName)); + AddPsetDefToDict(schemaName, Qto_SpaceBaseQuantitiesIFC2x2(schemaName)); + AddPsetDefToDict(schemaName, Qto_BeamBaseQuantitiesIFC2x2(schemaName)); + AddPsetDefToDict(schemaName, Qto_ColumnBaseQuantitiesIFC2x2(schemaName)); + AddPsetDefToDict(schemaName, Qto_MemberBaseQuantitiesIFC2x2(schemaName)); + AddPsetDefToDict(schemaName, Qto_CoveringBaseQuantitiesIFC2x2(schemaName)); + AddPsetDefToDict(schemaName, Qto_OpeningElementBaseQuantitiesIFC2x2(schemaName)); + AddPsetDefToDict(schemaName, Qto_SlabBaseQuantitiesIFC2x2(schemaName)); + AddPsetDefToDict(schemaName, Qto_RoofBaseQuantitiesIFC2x2(schemaName)); + AddPsetDefToDict(schemaName, Qto_WallBaseQuantitiesIFC2x2(schemaName)); + } + else if (schemaName.StartsWith("IFC2X3", StringComparison.InvariantCultureIgnoreCase)) { AddPsetDefToDict(schemaName, Qto_SiteBaseQuantitiesIFC2x3(schemaName)); AddPsetDefToDict(schemaName, Qto_BuildingBaseQuantitiesIFC2x3(schemaName)); @@ -1172,6 +1188,351 @@ public void Process2x3QtoSets(string schemaName) } } + private PsetDefinition Qto_SiteBaseQuantitiesIFC2x2(string schemaName) + { + PsetDefinition psetD = new PsetDefinition(); + psetD.Name = "Qto_SiteBaseQuantities"; + psetD.IfcVersion = schemaName; + psetD.ApplicableClasses = new List() { "IfcSite" }; + psetD.properties = new HashSet(); + + psetD.properties.Add(new PsetProperty() + { + Name = "SitePerimeter", + PropertyType = new PropertySingleValue() { DataType = "IfcPositiveLengthMeasure" } + }); + + psetD.properties.Add(new PsetProperty() + { + Name = "SiteArea", + PropertyType = new PropertySingleValue() { DataType = "IfcAreaMeasure" } + }); + + return psetD; + } + + private PsetDefinition Qto_BuildingBaseQuantitiesIFC2x2(string schemaName) + { + PsetDefinition psetD = new PsetDefinition(); + psetD.Name = "Qto_BuildingBaseQuantities"; + psetD.IfcVersion = schemaName; + psetD.ApplicableClasses = new List() { "IfcBuilding" }; + psetD.properties = new HashSet(); + + psetD.properties.Add(new PsetProperty() + { + Name = "TotalHeight", + PropertyType = new PropertySingleValue() { DataType = "IfcPositiveLengthMeasure" } + }); + + psetD.properties.Add(new PsetProperty() + { + Name = "SiteCoverage", + PropertyType = new PropertySingleValue() { DataType = "IfcAreaMeasure" } + }); + + psetD.properties.Add(new PsetProperty() + { + Name = "GrossFloorArea", + PropertyType = new PropertySingleValue() { DataType = "IfcAreaMeasure" } + }); + + psetD.properties.Add(new PsetProperty() + { + Name = "NetFloorArea", + PropertyType = new PropertySingleValue() { DataType = "IfcAreaMeasure" } + }); + + psetD.properties.Add(new PsetProperty() + { + Name = "GrossVolume", + PropertyType = new PropertySingleValue() { DataType = "IfcVolumeMeasure" } + }); + + return psetD; + } + + private PsetDefinition Qto_BuildingStoreyBaseQuantitiesIFC2x2(string schemaName) + { + PsetDefinition psetD = new PsetDefinition(); + psetD.Name = "Qto_BuildingStoreyBaseQuantities"; + psetD.IfcVersion = schemaName; + psetD.ApplicableClasses = new List() { "IfcBuildingStorey" }; + psetD.properties = new HashSet(); + + psetD.properties.Add(new PsetProperty() + { + Name = "TotalHeight", + PropertyType = new PropertySingleValue() { DataType = "IfcPositiveLengthMeasure" } + }); + + psetD.properties.Add(new PsetProperty() + { + Name = "SiteCoverage", + PropertyType = new PropertySingleValue() { DataType = "IfcAreaMeasure" } + }); + + psetD.properties.Add(new PsetProperty() + { + Name = "NetFloorArea", + PropertyType = new PropertySingleValue() { DataType = "IfcAreaMeasure" } + }); + + psetD.properties.Add(new PsetProperty() + { + Name = "GrossVolume", + PropertyType = new PropertySingleValue() { DataType = "IfcVolumeMeasure" } + }); + + return psetD; + } + + private PsetDefinition Qto_SpaceBaseQuantitiesIFC2x2(string schemaName) + { + PsetDefinition psetD = new PsetDefinition(); + psetD.Name = "Qto_SpaceBaseQuantities"; + psetD.IfcVersion = schemaName; + psetD.ApplicableClasses = new List() { "IfcSpace" }; + psetD.properties = new HashSet(); + + psetD.properties.Add(new PsetProperty() + { + Name = "AverageHeight", + PropertyType = new PropertySingleValue() { DataType = "IfcPositiveLengthMeasure" } + }); + + psetD.properties.Add(new PsetProperty() + { + Name = "AverageClearHeight", + PropertyType = new PropertySingleValue() { DataType = "IfcPositiveLengthMeasure" } + }); + + psetD.properties.Add(new PsetProperty() + { + Name = "AverageGrossHeight", + PropertyType = new PropertySingleValue() { DataType = "IfcPositiveLengthMeasure" } + }); + + psetD.properties.Add(new PsetProperty() + { + Name = "Perimeter", + PropertyType = new PropertySingleValue() { DataType = "IfcPositiveLengthMeasure" } + }); + + psetD.properties.Add(new PsetProperty() + { + Name = "Area", + PropertyType = new PropertySingleValue() { DataType = "IfcAreaMeasure" } + }); + + psetD.properties.Add(new PsetProperty() + { + Name = "Volume", + PropertyType = new PropertySingleValue() { DataType = "IfcVolumeMeasure" } + }); + + return psetD; + } + + private PsetDefinition Qto_CoveringBaseQuantitiesIFC2x2(string schemaName) + { + PsetDefinition psetD = new PsetDefinition(); + psetD.Name = "Qto_CoveringBaseQuantities"; + psetD.IfcVersion = schemaName; + psetD.ApplicableClasses = new List() { "IfcCovering" }; + psetD.properties = new HashSet(); + + psetD.properties.Add(new PsetProperty() + { + Name = "CoveredArea", + PropertyType = new PropertySingleValue() { DataType = "IfcAreaMeasure" } + }); + + return psetD; + } + + private PsetDefinition Qto_BeamBaseQuantitiesIFC2x2(string schemaName) + { + PsetDefinition psetD = new PsetDefinition(); + psetD.Name = "Qto_BeamBaseQuantities"; + psetD.IfcVersion = schemaName; + psetD.ApplicableClasses = new List() { "IfcBeam" }; + psetD.properties = new HashSet(); + AddQuantitiesForStructuralElement(ref psetD); + + return psetD; + } + + private PsetDefinition Qto_ColumnBaseQuantitiesIFC2x2(string schemaName) + { + PsetDefinition psetD = new PsetDefinition(); + psetD.Name = "Qto_ColumnBaseQuantities"; + psetD.IfcVersion = schemaName; + psetD.ApplicableClasses = new List() { "IfcColumn" }; + psetD.properties = new HashSet(); + AddQuantitiesForStructuralElement(ref psetD); + + return psetD; + } + + private PsetDefinition Qto_MemberBaseQuantitiesIFC2x2(string schemaName) + { + PsetDefinition psetD = new PsetDefinition(); + psetD.Name = "Qto_MemberBaseQuantities"; + psetD.IfcVersion = schemaName; + psetD.ApplicableClasses = new List() { "IfcMember" }; + psetD.properties = new HashSet(); + AddQuantitiesForStructuralElement(ref psetD); + + return psetD; + } + + private PsetDefinition Qto_OpeningElementBaseQuantitiesIFC2x2(string schemaName) + { + PsetDefinition psetD = new PsetDefinition(); + psetD.Name = "Qto_OpeningElementBaseQuantities"; + psetD.IfcVersion = schemaName; + psetD.ApplicableClasses = new List() { "IfcOpeningElement" }; + psetD.properties = new HashSet(); + + psetD.properties.Add(new PsetProperty() + { + Name = "OpeningArea", + PropertyType = new PropertySingleValue() { DataType = "IfcAreaMeasure" } + }); + + return psetD; + } + + private PsetDefinition Qto_WallBaseQuantitiesIFC2x2(string schemaName) + { + PsetDefinition psetD = new PsetDefinition(); + psetD.Name = "Qto_WallBaseQuantities"; + psetD.IfcVersion = schemaName; + psetD.ApplicableClasses = new List() { "IfcWall", "IfcWallStandardCase" }; + psetD.properties = new HashSet(); + + psetD.properties.Add(new PsetProperty() + { + Name = "NominalLength", + PropertyType = new PropertySingleValue() { DataType = "IfcPositiveLengthMeasure" } + }); + + psetD.properties.Add(new PsetProperty() + { + Name = "GrossFootprintArea", + PropertyType = new PropertySingleValue() { DataType = "IfcAreaMeasure" } + }); + + psetD.properties.Add(new PsetProperty() + { + Name = "NetFootprintArea", + PropertyType = new PropertySingleValue() { DataType = "IfcAreaMeasure" } + }); + + psetD.properties.Add(new PsetProperty() + { + Name = "GrossSideAreaLeft", + PropertyType = new PropertySingleValue() { DataType = "IfcAreaMeasure" } + }); + + psetD.properties.Add(new PsetProperty() + { + Name = "NetSideAreaLeft", + PropertyType = new PropertySingleValue() { DataType = "IfcAreaMeasure" } + }); + + psetD.properties.Add(new PsetProperty() + { + Name = "GrossSideAreaRight", + PropertyType = new PropertySingleValue() { DataType = "IfcAreaMeasure" } + }); + + psetD.properties.Add(new PsetProperty() + { + Name = "NetSideAreaRight", + PropertyType = new PropertySingleValue() { DataType = "IfcAreaMeasure" } + }); + + psetD.properties.Add(new PsetProperty() + { + Name = "GrossVolume", + PropertyType = new PropertySingleValue() { DataType = "IfcVolumeMeasure" } + }); + + psetD.properties.Add(new PsetProperty() + { + Name = "NetVolume", + PropertyType = new PropertySingleValue() { DataType = "IfcVolumeMeasure" } + }); + + return psetD; + } + + private PsetDefinition Qto_SlabBaseQuantitiesIFC2x2(string schemaName) + { + PsetDefinition psetD = new PsetDefinition(); + psetD.Name = "Qto_SlabBaseQuantities"; + psetD.IfcVersion = schemaName; + psetD.ApplicableClasses = new List() { "IfcSlab" }; + psetD.properties = new HashSet(); + + psetD.properties.Add(new PsetProperty() + { + Name = "Perimeter", + PropertyType = new PropertySingleValue() { DataType = "IfcPositiveLengthMeasure" } + }); + + psetD.properties.Add(new PsetProperty() + { + Name = "SurfaceArea", + PropertyType = new PropertySingleValue() { DataType = "IfcAreaMeasure" } + }); + + psetD.properties.Add(new PsetProperty() + { + Name = "GrossVolume", + PropertyType = new PropertySingleValue() { DataType = "IfcVolumeMeasure" } + }); + + psetD.properties.Add(new PsetProperty() + { + Name = "NetVolume", + PropertyType = new PropertySingleValue() { DataType = "IfcVolumeMeasure" } + }); + + psetD.properties.Add(new PsetProperty() + { + Name = "GrossWeight", + PropertyType = new PropertySingleValue() { DataType = "IfcMassMeasure" } + }); + + psetD.properties.Add(new PsetProperty() + { + Name = "NetWeight", + PropertyType = new PropertySingleValue() { DataType = "IfcMassMeasure" } + }); + + return psetD; + } + + private PsetDefinition Qto_RoofBaseQuantitiesIFC2x2(string schemaName) + { + PsetDefinition psetD = new PsetDefinition(); + psetD.Name = "Qto_RoofBaseQuantities"; + psetD.IfcVersion = schemaName; + psetD.ApplicableClasses = new List() { "IfcRoof" }; + psetD.properties = new HashSet(); + + psetD.properties.Add(new PsetProperty() + { + Name = "TotalSurfaceArea", + PropertyType = new PropertySingleValue() { DataType = "IfcAreaMeasure" } + }); + + return psetD; + } + private PsetDefinition Qto_SiteBaseQuantitiesIFC2x3(string schemaName) { PsetDefinition psetD = new PsetDefinition(); @@ -1389,27 +1750,6 @@ private PsetDefinition Qto_CoveringBaseQuantitiesIFC2x3(string schemaName) return psetD; } - private void AddQuantitiesForDoorOrWindow(ref PsetDefinition psetD) - { - psetD.properties.Add(new PsetProperty() - { - Name = "Height", - PropertyType = new PropertySingleValue() { DataType = "IfcPositiveLengthMeasure" } - }); - - psetD.properties.Add(new PsetProperty() - { - Name = "Width", - PropertyType = new PropertySingleValue() { DataType = "IfcPositiveLengthMeasure" } - }); - - psetD.properties.Add(new PsetProperty() - { - Name = "Area", - PropertyType = new PropertySingleValue() { DataType = "IfcAreaMeasure" } - }); - } - private void AddQuantitiesForStructuralElement(ref PsetDefinition psetD) { psetD.properties.Add(new PsetProperty()