Skip to content

Commit 1fcf093

Browse files
author
Wawan Solihin
committed
Fix issues with exporting classification
1 parent 066db42 commit 1fcf093

File tree

22 files changed

+140
-82
lines changed

22 files changed

+140
-82
lines changed

Install/Program Files to Install/bundle/Contents/Resources/ADSKIFCExporterHelp.htm

+9-1
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,15 @@ <h3>Support Information</h3>
237237
<h2 id="VersionHistory" name="VersionHistory">Version History</h2>
238238

239239
<div class="versionset">
240-
240+
<div class="version">23.2.4.0</div><div class="versioninfo-bullet">
241+
<br><p>
242+
Bugfix:
243+
<ul>
244+
<li> Fix issue with incorrect classification export.
245+
</ul>
246+
</p>
247+
</div>
248+
<br>
241249
<div class="version">23.2.3.0</div><div class="versioninfo-bullet">
242250
<br><p>
243251
General:
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<ApplicationPackage SchemaVersion="1.0" AutodeskProduct="Revit" ProductType="Application" Name="IFC Exporter for Revit" AppVersion="23.2.3.0" Description="This application seamlessly replaces the built-in IFC export capabilities of Revit 2023. " Author="Autodesk" Icon=".\Contents\Resources\IFCExporter.png" AppNameSpace="appstore.exchange.autodesk.com" OnlineDocumentation="http://www.autodesk.com" HelpFile=".\Contents\Resources\ADSKIFCExporterHelp.htm" ProductCode="{40527B9C-60B8-407E-BF56-7AAA67F07ACA}" UpgradeCode="{A27E008E-2278-4F84-BB3B-59C605168900}" SupportedLocales="Enu">
2+
<ApplicationPackage SchemaVersion="1.0" AutodeskProduct="Revit" ProductType="Application" Name="IFC Exporter for Revit" AppVersion="23.2.4.0" Description="This application seamlessly replaces the built-in IFC export capabilities of Revit 2023. " Author="Autodesk" Icon=".\Contents\Resources\IFCExporter.png" AppNameSpace="appstore.exchange.autodesk.com" OnlineDocumentation="http://www.autodesk.com" HelpFile=".\Contents\Resources\ADSKIFCExporterHelp.htm" ProductCode="{40527B9C-60B8-407E-BF56-7AAA67F07ACA}" UpgradeCode="{A27E008E-2278-4F84-BB3B-59C605168900}" SupportedLocales="Enu">
33
<CompanyDetails Name="Autodesk, Inc." Phone=" " Url="http://www.autodesk.com" Email="[email protected]" />
44
<RuntimeRequirements OS="Win64" Platform="Revit" SeriesMin="R2023" SeriesMax="R2023" />
55
<Components Description="2023">
66
<RuntimeRequirements OS="Win64" Platform="Revit" SeriesMin="R2023" SeriesMax="R2023" />
7-
<ComponentEntry AppName="IFC For Revit 2023" Version="23.2.3" ModuleName="./Contents/2023/IFCExporterUIOverride.addin" AppDescription="IFC For Revit 2023" />
8-
<ComponentEntry AppName="IFC For Revit 2023" Version="23.2.3" ModuleName="./Contents/2023/Revit.IFC.addin" AppDescription="IFC For Revit 2023" />
7+
<ComponentEntry AppName="IFC For Revit 2023" Version="23.2.4" ModuleName="./Contents/2023/IFCExporterUIOverride.addin" AppDescription="IFC For Revit 2023" />
8+
<ComponentEntry AppName="IFC For Revit 2023" Version="23.2.4" ModuleName="./Contents/2023/Revit.IFC.addin" AppDescription="IFC For Revit 2023" />
99
</Components>
1010
</ApplicationPackage>

Install/RevitIFCSetupWix/Product.wxs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
33
xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
44

5-
<Product Id="1A9C2C21-2322-42D2-0000-992E73C12300" Name="Revit IFC 2023" Language="1033" Version="23.2.3.0" Manufacturer="Autodesk" UpgradeCode="1A9C2C21-23B8-42D2-0000-992E73C11B3F">
5+
<Product Id="40C6C8DB-A732-48F4-935C-1947DD171167" Name="Revit IFC 2023" Language="1033" Version="23.2.4.0" Manufacturer="Autodesk" UpgradeCode="1A9C2C21-23B8-42D2-0000-992E73C11B3F">
66
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />
77

88
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />

Install/RevitIFCSetupWix/RevitIFCSetupWix.wixproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<ProductVersion>3.8</ProductVersion>
77
<ProjectGuid>7dfbd495-c588-4c7b-b8f6-5b793adb06f2</ProjectGuid>
88
<SchemaVersion>2.0</SchemaVersion>
9-
<OutputName>IFC for Revit 2023.2.3.0</OutputName>
9+
<OutputName>IFC for Revit 2023.2.4.0</OutputName>
1010
<OutputType>Package</OutputType>
1111
<WixTargetsPath Condition=" '$(WixTargetsPath)' == '' AND '$(MSBuildExtensionsPath32)' != '' ">$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\Wix.targets</WixTargetsPath>
1212
<WixTargetsPath Condition=" '$(WixTargetsPath)' == '' ">$(MSBuildExtensionsPath)\Microsoft\WiX\v3.x\Wix.targets</WixTargetsPath>

Install/RevitIFCSetupWix/buildInstaller.bat

+4-4
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ rem It is necessary to add the Wix bin directory to the system path temporarily
1111
SET PATH=%PATH%;%WixRoot%
1212

1313
candle.exe -dProjectDir=%2 -ext WixUtilExtension %2Product.wxs
14-
light.exe -ext WixUtilExtension -out RevitIFC2023.2.3.msi product.wixobj -ext WixUIExtension
14+
light.exe -ext WixUtilExtension -out RevitIFC2023.2.4.msi product.wixobj -ext WixUIExtension
1515

16-
copy RevitIFC2023.2.3.msi %1..\Releasex64
17-
del RevitIFC2023.2.3.msi
16+
copy RevitIFC2023.2.4.msi %1..\Releasex64
17+
del RevitIFC2023.2.4.msi
1818

19-
echo %1..\Releasex64\RevitIFC2023.2.3.msi
19+
echo %1..\Releasex64\RevitIFC2023.2.4.msi

Source/IFCExporterUIOverride/IFCClassificationUI.xaml

+20-16
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,24 @@
1515
HorizontalAlignment="Stretch"
1616
Margin="10,5,5,10"
1717
Height="315">
18-
<Grid Height="276" VerticalAlignment="Top" Margin="0,7,0,0" Grid.RowSpan="2">
19-
<Label Content="{x:Static p:Resources.Name}" Height="28" HorizontalAlignment="Left" Margin="16,10,0,0" Name="ClassificationName" VerticalAlignment="Top" Width="53" />
20-
<TextBox Text="{Binding Path=ClassificationName, UpdateSourceTrigger=PropertyChanged}" Height="23" HorizontalAlignment="Stretch" Margin="235,10,27,0" Name="ClassificationNameTextBox" VerticalAlignment="Top" Width="300" HorizontalContentAlignment="Stretch" ToolTip="{x:Static p:Resources.ClassificationSystemName}" />
21-
<Label Content="{x:Static p:Resources.SourcePublisher}" Height="28" HorizontalAlignment="Left" Margin="16,39,0,0" Name="SourceOrPublisher" VerticalAlignment="Top" Width="105" Grid.ColumnSpan="2" />
22-
<TextBox Text="{Binding Path=ClassificationSource, UpdateSourceTrigger=PropertyChanged}" Height="23" HorizontalAlignment="Stretch" Margin="235,39,27,0" Name="ClassificationSourceTextBox" VerticalAlignment="Top" Width="300" HorizontalContentAlignment="Stretch" ToolTip="{x:Static p:Resources.ClassificationSystemSource}" />
23-
<Label Content="{x:Static p:Resources.Edition}" Height="28" HorizontalAlignment="Left" Margin="16,68,0,0" Name="Edition" VerticalAlignment="Top" IsEnabled="True" Width="53" />
24-
<TextBox Text="{Binding Path=ClassificationEdition, UpdateSourceTrigger=PropertyChanged}" Height="23" HorizontalAlignment="Stretch" Margin="235,68,27,0" Name="ClassificationEditionTextBox" VerticalAlignment="Top" Width="300" HorizontalContentAlignment="Stretch" ToolTip="{x:Static p:Resources.ClassificationSystemEdition}" />
25-
<Label Content="{x:Static p:Resources.EditionDate}" Height="35" HorizontalAlignment="Left" Margin="16,96,0,0" Name="EditionDate" VerticalAlignment="Top" RenderTransformOrigin="0.441,0.466" Width="95" Grid.ColumnSpan="2" />
26-
<DatePicker SelectedDate="{Binding Path=ClassificationEditionDate}" Height="25" Margin="235,97,212,0" Name="datePicker1" VerticalAlignment="Top" />
27-
<Label Content="{x:Static p:Resources.DocumentationLocation}" Height="28" HorizontalAlignment="Left" Margin="16,132,0,0" Name="location" VerticalAlignment="Top" Width="186" Grid.ColumnSpan="2" />
28-
<TextBox Text="{Binding Path=ClassificationLocation, UpdateSourceTrigger=PropertyChanged}" Height="28" Margin="235,132,27,0" Name="ClassificationLocationtextBox" VerticalAlignment="Top" ToolTip="{x:Static p:Resources.ClassificationAltLocation}"/>
29-
<Label Content="{x:Static p:Resources.ClassificationFieldName}" HorizontalAlignment="Left" Margin="16,165,0,0" Name="Label_FieldName" VerticalAlignment="Top" Width="186" Grid.ColumnSpan="2" />
30-
<TextBox Text="{Binding Path=ClassificationFieldName, UpdateSourceTrigger=PropertyChanged}" Height="28" Margin="235,165,27,0" Name="TextBox_FieldName" VerticalAlignment="Top" ToolTip="{x:Static p:Resources.ClassificationAltName}"/>
31-
<Button Content="{x:Static p:Resources.OK}" Height="22" x:Name="buttonOK" Width="75" Click="buttonOK_Click" Margin="0,0,106,12" HorizontalAlignment="Right" VerticalAlignment="Bottom"/>
32-
<Button Content="{x:Static p:Resources.Cancel}" Height="22" Name="buttonCancel" Width="75" Click="bottonCancel_Click" RenderTransformOrigin="0.507,-4.636" Margin="0,0,26,12" HorizontalAlignment="Right" VerticalAlignment="Bottom"/>
33-
</Grid>
18+
<Grid Height="276" VerticalAlignment="Top" Margin="0,7,0,0" Grid.RowSpan="2">
19+
<Grid.ColumnDefinitions>
20+
<ColumnDefinition Width="239*"/>
21+
<ColumnDefinition Width="331*"/>
22+
</Grid.ColumnDefinitions>
23+
<Label Content="{x:Static p:Resources.Name}" Height="28" HorizontalAlignment="Left" Margin="16,10,0,0" Name="ClassificationName" VerticalAlignment="Top" Width="53" />
24+
<TextBox Text="{Binding Path=ClassificationName, UpdateSourceTrigger=PropertyChanged}" Height="23" Margin="10,10,26,0" Name="ClassificationNameTextBox" VerticalAlignment="Top" HorizontalContentAlignment="Stretch" ToolTip="{x:Static p:Resources.ClassificationSystemName}" Grid.Column="1" />
25+
<Label Content="{x:Static p:Resources.SourcePublisher}" Height="28" HorizontalAlignment="Left" Margin="16,39,0,0" Name="SourceOrPublisher" VerticalAlignment="Top" Width="105" />
26+
<TextBox Text="{Binding Path=ClassificationSource, UpdateSourceTrigger=PropertyChanged}" Height="23" Margin="10,39,26,0" Name="ClassificationSourceTextBox" VerticalAlignment="Top" HorizontalContentAlignment="Stretch" ToolTip="{x:Static p:Resources.ClassificationSystemSource}" Grid.Column="1" />
27+
<Label Content="{x:Static p:Resources.Edition}" Height="28" HorizontalAlignment="Left" Margin="16,68,0,0" Name="Edition" VerticalAlignment="Top" IsEnabled="True" Width="53" />
28+
<TextBox Text="{Binding Path=ClassificationEdition, UpdateSourceTrigger=PropertyChanged}" Height="23" Margin="10,68,26,0" Name="ClassificationEditionTextBox" VerticalAlignment="Top" HorizontalContentAlignment="Stretch" ToolTip="{x:Static p:Resources.ClassificationSystemEdition}" Grid.Column="1" />
29+
<Label Content="{x:Static p:Resources.EditionDate}" Height="35" HorizontalAlignment="Left" Margin="16,96,0,0" Name="EditionDate" VerticalAlignment="Top" RenderTransformOrigin="0.441,0.466" Width="95" />
30+
<DatePicker Height="25" Margin="10,97,200,0" Name="datePicker1" VerticalAlignment="Top" Grid.Column="1" SelectedDateChanged="datePicker1_SelectedDateChanged"/>
31+
<Label Content="{x:Static p:Resources.DocumentationLocation}" Height="28" HorizontalAlignment="Left" Margin="16,132,0,0" Name="location" VerticalAlignment="Top" Width="186" />
32+
<TextBox Text="{Binding Path=ClassificationLocation, UpdateSourceTrigger=PropertyChanged}" Height="28" Margin="10,132,26,0" Name="ClassificationLocationtextBox" VerticalAlignment="Top" ToolTip="{x:Static p:Resources.ClassificationAltLocation}" Grid.Column="1"/>
33+
<Label Content="{x:Static p:Resources.ClassificationFieldName}" HorizontalAlignment="Left" Margin="16,165,0,0" Name="Label_FieldName" VerticalAlignment="Top" Width="186" Height="26" />
34+
<TextBox Text="{Binding Path=ClassificationFieldName, UpdateSourceTrigger=PropertyChanged}" Height="28" Margin="10,165,26,0" Name="TextBox_FieldName" VerticalAlignment="Top" ToolTip="{x:Static p:Resources.ClassificationAltName}" Grid.Column="1"/>
35+
<Button Content="{x:Static p:Resources.OK}" Height="22" x:Name="buttonOK" Width="75" Click="buttonOK_Click" Margin="0,0,106,12" HorizontalAlignment="Right" VerticalAlignment="Bottom" Grid.Column="1"/>
36+
<Button Content="{x:Static p:Resources.Cancel}" Height="22" Name="buttonCancel" Width="75" Click="bottonCancel_Click" RenderTransformOrigin="0.507,-4.636" Margin="0,0,26,12" HorizontalAlignment="Right" VerticalAlignment="Bottom" Grid.Column="1"/>
37+
</Grid>
3438
</auiw:ChildWindow>

Source/IFCExporterUIOverride/IFCClassificationUI.xaml.cs

+15-5
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
using System;
2222
using System.Collections.Generic;
2323
using System.Windows;
24+
using System.Windows.Controls;
2425

2526

2627
namespace BIM.IFC.Export.UI
@@ -43,8 +44,13 @@ public partial class IFCClassificationWindow : ChildWindow
4344
public IFCClassificationWindow(IFCExportConfiguration configuration)
4445
{
4546
InitializeComponent();
46-
m_newClassification = configuration.ClassificationSettings;
47-
datePicker1.SelectedDate = DateTime.Today;
47+
m_newClassification = configuration.ClassificationSettings.IsClassificationEmpty()? m_newClassification : configuration.ClassificationSettings;
48+
49+
if (m_newClassification.ClassificationEditionDate <= DateTime.MinValue || m_newClassification.ClassificationEditionDate >= DateTime.MaxValue)
50+
{
51+
m_newClassification.ClassificationEditionDate = DateTime.Now.Date;
52+
}
53+
datePicker1.SelectedDate = m_newClassification.ClassificationEditionDate.Date;
4854
}
4955

5056
/// <summary>
@@ -72,6 +78,7 @@ private void buttonOK_Click(object sender, RoutedEventArgs args)
7278
{
7379
fillMandatoryFields(m_newClassification);
7480
}
81+
m_newClassification.ClassificationEditionDate = datePicker1.SelectedDate.Value.Date;
7582
IFCClassificationMgr.UpdateClassification(IFCCommandOverrideApplication.TheDocument, m_newClassification);
7683
}
7784

@@ -122,11 +129,14 @@ private void ClassificationTab_Initialized(object sender, EventArgs e)
122129
{
123130
m_savedClassification = m_newClassification.Clone();
124131
}
132+
}
125133

126-
if (m_newClassification.ClassificationEditionDate <= DateTime.MinValue || m_newClassification.ClassificationEditionDate >= DateTime.MaxValue)
134+
private void datePicker1_SelectedDateChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e)
135+
{
136+
var picker = sender as DatePicker;
137+
if (picker != null)
127138
{
128-
DateTime today = DateTime.Now;
129-
m_newClassification.ClassificationEditionDate = today;
139+
m_newClassification.ClassificationEditionDate = picker.SelectedDate.Value.Date; // Picker only use the Date
130140
}
131141
}
132142
}

Source/IFCExporterUIOverride/IFCExporterUIWindow.xaml.cs

+5-1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
using System.Windows.Controls;
3434
using UserInterfaceUtility.Json;
3535
using Revit.IFC.Common.Enums;
36+
using Revit.IFC.Common.Extensions;
3637

3738
namespace BIM.IFC.Export.UI
3839
{
@@ -702,10 +703,12 @@ private void buttonSaveSetup_Click(object sender, RoutedEventArgs e)
702703
bool? fileDialogResult = saveFileDialog.ShowDialog();
703704
if (fileDialogResult.HasValue && fileDialogResult.Value)
704705
{
706+
IFCExportConfiguration configToSave = configuration.Clone();
707+
configToSave.Name = Path.GetFileNameWithoutExtension(saveFileDialog.FileName);
705708
using (StreamWriter sw = new StreamWriter(saveFileDialog.FileName))
706709
{
707710
JavaScriptSerializer js = new JavaScriptSerializer();
708-
sw.Write(SerializerUtils.FormatOutput(js.Serialize(configuration)));
711+
sw.Write(SerializerUtils.FormatOutput(js.Serialize(configToSave)));
709712
}
710713
}
711714
}
@@ -743,6 +746,7 @@ private void buttonLoadSetup_Click(object sender, RoutedEventArgs e)
743746
// set new configuration as selected
744747
listBoxConfigurations.Items.Add(configuration);
745748
listBoxConfigurations.SelectedItem = configuration;
749+
IFCClassificationMgr.UpdateClassification(IFCExport.TheDocument, configuration.ClassificationSettings);
746750
}
747751
}
748752
}

Source/IFCExporterUIOverride/Properties/AssemblyInfo.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,6 @@
6666
// The following information is used in the Open Source version as the release version number.
6767
// The number will show up in the Title bar of the export dialog as well as at the IFC header file
6868
// This number must be manually updated prior to releasing the new version
69-
[assembly: AssemblyVersion("23.2.3.0")]
70-
[assembly: AssemblyFileVersion("23.2.3.0")]
69+
[assembly: AssemblyVersion("23.2.4.0")]
70+
[assembly: AssemblyFileVersion("23.2.4.0")]
7171
#endif

Source/Revit.IFC.Common/Extension/IFCClassification.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ public DateTime ClassificationEditionDate
8383
get { return classificationEditionDate; }
8484
set
8585
{
86-
classificationEditionDate = value;
86+
classificationEditionDate = value.Date;
8787
// Call OnPropertyChanged whenever the property is updated
8888
OnPropertyChanged("datePicker1");
8989
}

Source/Revit.IFC.Common/Extension/IFCClassificationMgr.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ public static bool GetSavedClassifications(Document document, Schema schema, out
237237
}
238238
catch
239239
{
240-
ifcClassificationSaved[noClass].ClassificationEditionDate = DateTime.Now;
240+
ifcClassificationSaved[noClass].ClassificationEditionDate = DateTime.Now.Date;
241241
}
242242

243243
ifcClassificationSaved[noClass].ClassificationLocation = savedClassification.Get<string>(schema.GetField(s_ClassificationLocation));

Source/Revit.IFC.Common/Properties/AssemblyInfo.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
[assembly: AssemblyTrademark("")]
1414
[assembly: AssemblyCulture("")]
1515

16-
[assembly: AssemblyVersion("23.2.3.0")]
17-
[assembly: AssemblyFileVersion("23.2.3.0")]
16+
[assembly: AssemblyVersion("23.2.4.0")]
17+
[assembly: AssemblyFileVersion("23.2.4.0")]
1818
#endif
1919

2020

Source/Revit.IFC.Export/Exporter/AssemblyInstanceExporter.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,6 @@ public static bool ExportAssemblyInstanceElement(ExporterIFC exporterIFC, Assemb
9090
string objectType = NamingUtil.GetObjectTypeOverride(element, NamingUtil.GetFamilyAndTypeName(element));
9191
assemblyInstanceHnd = IFCInstanceExporter.CreateSystem(file, guid, ownerHistory, name, description, objectType);
9292

93-
// Create classification reference when System has classification filed name assigned to it
94-
ClassificationUtil.CreateClassification(exporterIFC, file, element, assemblyInstanceHnd);
95-
9693
HashSet<IFCAnyHandle> relatedBuildings =
9794
new HashSet<IFCAnyHandle>() { ExporterCacheManager.BuildingHandle };
9895

@@ -157,6 +154,9 @@ public static bool ExportAssemblyInstanceElement(ExporterIFC exporterIFC, Assemb
157154
if (assemblyInstanceHnd == null)
158155
return false;
159156

157+
// Create classification reference when the Assembly has classification field name assigned to it
158+
ClassificationUtil.CreateClassification(exporterIFC, file, element, assemblyInstanceHnd);
159+
160160
// relateToLevel depends on how the AssemblyInstance is being mapped to IFC, above.
161161
productWrapper.AddElement(element, assemblyInstanceHnd, levelInfo, null, relateToLevel, exportAs);
162162

0 commit comments

Comments
 (0)