From a2cdcbefa01633bab487fc654e0b88be788288ec Mon Sep 17 00:00:00 2001 From: babio Date: Wed, 15 Jan 2025 06:11:29 -0800 Subject: [PATCH 1/2] Code update --- .../IFCExportConfiguration.cs | 7 +++++ .../IFCExportConfigurationsMap.cs | 26 +++++++++++-------- .../IFCExporterUIWindow.xaml | 11 ++++---- .../IFCExporterUIWindow.xaml.cs | 20 ++++++++++++++ .../Properties/Resources.Designer.cs | 9 +++++++ .../Properties/Resources.resx | 3 +++ Source/IFCExporterUIOverride/packages.config | 2 +- .../Utility/IfcSchemaEntityTree.cs | 13 ++++++++-- .../Revit.IFC.Export/Exporter/BodyExporter.cs | 7 +++-- .../Exporter/ExporterInitializer.cs | 1 + .../PropertySet/PropertySetDescription.cs | 7 ++++- .../Exporter/PropertySet/PropertySetEntry.cs | 5 ++-- .../PropertySet/PropertySetEntryMap.cs | 10 ++++--- .../Utility/IFCExportInfoPair.cs | 4 +-- .../Utility/PropertySetOptions.cs | 6 +++++ 15 files changed, 101 insertions(+), 30 deletions(-) diff --git a/Source/IFCExporterUIOverride/IFCExportConfiguration.cs b/Source/IFCExporterUIOverride/IFCExportConfiguration.cs index db175ce5..d29cba26 100644 --- a/Source/IFCExporterUIOverride/IFCExportConfiguration.cs +++ b/Source/IFCExporterUIOverride/IFCExportConfiguration.cs @@ -193,6 +193,11 @@ public KnownERNames ExchangeRequirement /// public string ExportUserDefinedPsetsFileName { get; set; } = ""; + /// + /// Whether or not to include type property to the user defined property sets. + /// + public bool UseTypePropertiesInInstacePSets { get; set; } = false; + /// /// True if the User decides to use the Parameter Mapping Table /// False if the user decides to ignore it @@ -434,6 +439,7 @@ public static IFCExportConfiguration CreateBuiltInConfiguration(IFCVersion ifcVe bool materialPsets, bool schedulesAsPSets, bool userDefinedPSets, + bool useTypePropertiesInInstacePSets, bool userDefinedParameterMapping, bool PlanElems2D, bool exportBoundingBox, @@ -471,6 +477,7 @@ public static IFCExportConfiguration CreateBuiltInConfiguration(IFCVersion ifcVe configuration.ExportMaterialPsets = materialPsets; configuration.ExportSchedulesAsPsets = schedulesAsPSets; configuration.ExportUserDefinedPsets = userDefinedPSets; + configuration.UseTypePropertiesInInstacePSets = useTypePropertiesInInstacePSets; configuration.ExportUserDefinedPsetsFileName = System.IO.Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + @"\" + configuration.Name + @".txt"; configuration.ExportUserDefinedParameterMapping = userDefinedParameterMapping; diff --git a/Source/IFCExporterUIOverride/IFCExportConfigurationsMap.cs b/Source/IFCExporterUIOverride/IFCExportConfigurationsMap.cs index d3e8b14a..41254371 100644 --- a/Source/IFCExporterUIOverride/IFCExportConfigurationsMap.cs +++ b/Source/IFCExporterUIOverride/IFCExportConfigurationsMap.cs @@ -75,22 +75,22 @@ public void AddBuiltInConfigurations() { // These are the built-in configurations. Provide a more extensible means of storage. // Order of construction: name, version, space boundaries, QTO, split walls, internal sets, 2d elems, boundingBox - AddOrReplace(IFCExportConfiguration.CreateBuiltInConfiguration(IFCVersion.IFC2x3CV2, 0, false, false, false, false, false, false, false, false, false, false, includeSteelElements: true)); - AddOrReplace(IFCExportConfiguration.CreateBuiltInConfiguration(IFCVersion.IFC2x3, 1, false, false, true, false, false, false, false, true, false, false, includeSteelElements: true)); - AddOrReplace(IFCExportConfiguration.CreateBuiltInConfiguration(IFCVersion.IFCCOBIE, 2, true, true, true, false, false, false, false, true, true, false, includeSteelElements: true)); - AddOrReplace(IFCExportConfiguration.CreateBuiltInConfiguration(IFCVersion.IFC2x3BFM, 1, true, true, false, false, false, false, false, true, false, false, includeSteelElements: true)); - AddOrReplace(IFCExportConfiguration.CreateBuiltInConfiguration(IFCVersion.IFC2x2, 1, false, false, true, false, false, false, false, false, false, false)); - AddOrReplace(IFCExportConfiguration.CreateBuiltInConfiguration(IFCVersion.IFC2x3FM, 1, true, false, false, false, true, true, false, true, true, false, includeSteelElements: true)); - AddOrReplace(IFCExportConfiguration.CreateBuiltInConfiguration(IFCVersion.IFC4RV, 0, true, false, false, false, false, false, false, false, false, false, includeSteelElements: true, + AddOrReplace(IFCExportConfiguration.CreateBuiltInConfiguration(IFCVersion.IFC2x3CV2, 0, false, false, false, false, false, false, false, false, false, false, false, includeSteelElements: true)); + AddOrReplace(IFCExportConfiguration.CreateBuiltInConfiguration(IFCVersion.IFC2x3, 1, false, false, true, false, false, false, false, false, true, false, false, includeSteelElements: true)); + AddOrReplace(IFCExportConfiguration.CreateBuiltInConfiguration(IFCVersion.IFCCOBIE, 2, true, true, true, false, false, false, false, false, true, true, false, includeSteelElements: true)); + AddOrReplace(IFCExportConfiguration.CreateBuiltInConfiguration(IFCVersion.IFC2x3BFM, 1, true, true, false, false, false, false, false, false, true, false, false, includeSteelElements: true)); + AddOrReplace(IFCExportConfiguration.CreateBuiltInConfiguration(IFCVersion.IFC2x2, 1, false, false, true, false, false, false, false, false, false, false, false)); + AddOrReplace(IFCExportConfiguration.CreateBuiltInConfiguration(IFCVersion.IFC2x3FM, 1, true, false, false, false, true, true, false, false, true, true, false, includeSteelElements: true)); + AddOrReplace(IFCExportConfiguration.CreateBuiltInConfiguration(IFCVersion.IFC4RV, 0, true, false, false, false, false, false, false, false, false, false, false, includeSteelElements: true, exchangeRequirement:KnownERNames.Architecture)); - AddOrReplace(IFCExportConfiguration.CreateBuiltInConfiguration(IFCVersion.IFC4RV, 0, true, false, false, false, false, false, false, false, false, false, includeSteelElements: true, + AddOrReplace(IFCExportConfiguration.CreateBuiltInConfiguration(IFCVersion.IFC4RV, 0, true, false, false, false, false, false, false, false, false, false, false, includeSteelElements: true, exchangeRequirement:KnownERNames.Structural)); - AddOrReplace(IFCExportConfiguration.CreateBuiltInConfiguration(IFCVersion.IFC4RV, 0, true, false, false, false, false, false, false, false, false, false, includeSteelElements: true, + AddOrReplace(IFCExportConfiguration.CreateBuiltInConfiguration(IFCVersion.IFC4RV, 0, true, false, false, false, false, false, false, false, false, false, false, includeSteelElements: true, exchangeRequirement:KnownERNames.BuildingService)); - AddOrReplace(IFCExportConfiguration.CreateBuiltInConfiguration(IFCVersion.IFC4DTV, 0, true, false, false, false, false, false, false, false, false, false, includeSteelElements: true)); + AddOrReplace(IFCExportConfiguration.CreateBuiltInConfiguration(IFCVersion.IFC4DTV, 0, true, false, false, false, false, false, false, false, false, false, false, includeSteelElements: true)); //Handling the IFC4x3 format for using the IFC Extension with Revit versions older than 2023.1 which does not support IFC4x3. if(OptionsUtil.IsIFC4x3Supported()) - AddOrReplace(IFCExportConfiguration.CreateBuiltInConfiguration(OptionsUtil.GetIFCVersionByName("IFC4x3"), 0, true, false, false, false, false, false, false, false, false, false, includeSteelElements: true)); + AddOrReplace(IFCExportConfiguration.CreateBuiltInConfiguration(OptionsUtil.GetIFCVersionByName("IFC4x3"), 0, true, false, false, false, false, false, false, false, false, false, false, includeSteelElements: true)); } /// @@ -146,6 +146,9 @@ public void AddSavedConfigurations() Field fieldExportUserDefinedPsetsFileName = m_OldSchema.GetField(s_setupExportUserDefinedPsetsFileName); if (fieldExportUserDefinedPsetsFileName != null) configuration.ExportUserDefinedPsetsFileName = configEntity.Get(s_setupExportUserDefinedPsetsFileName); + Field fieldUseTypePropertiesInInstacePSets = m_OldSchema.GetField(s_setupUseTypePropertiesInInstacePSets); + if (fieldExportUserDefinedPsets != null) + configuration.UseTypePropertiesInInstacePSets = configEntity.Get(s_setupUseTypePropertiesInInstacePSets); Field fieldExportUserDefinedParameterMapingTable = m_OldSchema.GetField(s_setupExportUserDefinedParameterMapping); if (fieldExportUserDefinedParameterMapingTable != null) @@ -371,6 +374,7 @@ public void AddSavedConfigurations() private const string s_setupExportUserDefinedPsetsFileName = "ExportUserDefinedPsetsFileName"; private const string s_setupExportUserDefinedParameterMapping = "ExportUserDefinedParameterMapping"; private const string s_setupExportUserDefinedParameterMappingFileName = "ExportUserDefinedParameterMappingFileName"; + private const string s_setupUseTypePropertiesInInstacePSets = "UseTypePropertiesInInstacePSets"; private const string s_setupExportLinkedFiles = "ExportLinkedFiles"; private const string s_setupIncludeSiteElevation = "IncludeSiteElevation"; private const string s_setupTessellationLevelOfDetail = "TessellationLevelOfDetail"; diff --git a/Source/IFCExporterUIOverride/IFCExporterUIWindow.xaml b/Source/IFCExporterUIOverride/IFCExporterUIWindow.xaml index 949dc327..0b750449 100644 --- a/Source/IFCExporterUIOverride/IFCExporterUIWindow.xaml +++ b/Source/IFCExporterUIOverride/IFCExporterUIWindow.xaml @@ -56,11 +56,12 @@ - -