Skip to content

Commit 161c04a

Browse files
authored
Merge pull request #377 from Autodesk/22.4_Update
22.4 update
2 parents 7f7681e + eca6261 commit 161c04a

34 files changed

+1094
-93
lines changed
Binary file not shown.
Binary file not shown.

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

+26
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,32 @@ <h2 id="VersionHistory" name="VersionHistory">Version History</h2>
238238

239239
<div class="versionset">
240240

241+
<div class="version">22.4.0.0</div><div class="versioninfo-bullet">
242+
243+
<br><p>
244+
General:
245+
<ul>
246+
<li>This version contains various improvements and bugfixes since the latest release of 22.3.0.0.
247+
</ul>
248+
<br>
249+
</p>
250+
<p>
251+
Improvements:
252+
<ul>
253+
<li>Updated Autodesk.SteelConnections.ASIFC.dll.
254+
<li>Updated code for compatibility with Revit 2022.1.1 API.
255+
</ul>
256+
</p>
257+
<br> <p>
258+
Bug Fixes:
259+
</p>
260+
<ul>
261+
<li>Fixed bug with steel connections elements exporting.
262+
<li>Fixed number of bugs related to differences in previous Revit API versions.
263+
</ul>
264+
</div>
265+
<br>
266+
241267
<div class="version">22.3.0.0</div><div class="versioninfo-bullet">
242268

243269
<br><p>

Install/Program Files to Install/bundle/PackageContents.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<RuntimeRequirements OS="Win64" Platform="Revit" SeriesMin="R2022" SeriesMax="R2022" />
99
<Components Description="2022">
1010
<RuntimeRequirements OS="Win64" Platform="Revit" SeriesMin="R2022" SeriesMax="R2022" />
11-
<ComponentEntry AppName="IFC For Revit 2022" Version="22.3.0" ModuleName="./Contents/2022/IFCExporterUIOverride.addin" AppDescription="IFC For Revit 2022" />
12-
<ComponentEntry AppName="IFC For Revit 2022" Version="22.3.0" ModuleName="./Contents/2022/Revit.IFC.addin" AppDescription="IFC For Revit 2022" />
11+
<ComponentEntry AppName="IFC For Revit 2022" Version="22.4.0" ModuleName="./Contents/2022/IFCExporterUIOverride.addin" AppDescription="IFC For Revit 2022" />
12+
<ComponentEntry AppName="IFC For Revit 2022" Version="22.4.0" ModuleName="./Contents/2022/Revit.IFC.addin" AppDescription="IFC For Revit 2022" />
1313
</Components>
1414
</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="73E9D55B-2254-449D-B9A2-98F52DEF3B0B" Name="Revit IFC 2022" Language="1033" Version="22.3.0.0" Manufacturer="Autodesk" UpgradeCode="254F4C8A-9ECA-4690-A718-21ACD3849485">
5+
<Product Id="29E8B537-6D0B-4014-B6CF-C16CD1750DA3" Name="Revit IFC 2022" Language="1033" Version="22.4.0.0" Manufacturer="Autodesk" UpgradeCode="254F4C8A-9ECA-4690-A718-21ACD3849485">
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 2022.3.0.0</OutputName>
9+
<OutputName>IFC for Revit 2022.4.0.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 RevitIFC2022.3.0.msi product.wixobj -ext WixUIExtension
14+
light.exe -ext WixUtilExtension -out RevitIFC2022.4.0.msi product.wixobj -ext WixUIExtension
1515

16-
copy RevitIFC2022.3.0.msi %1..\Releasex64
17-
del RevitIFC2022.3.0.msi
16+
copy RevitIFC2022.4.0.msi %1..\Releasex64
17+
del RevitIFC2022.4.0.msi
1818

19-
echo %1..\Releasex64\RevitIFC2022.3.0.msi
19+
echo %1..\Releasex64\RevitIFC2022.4.0.msi

Source/IFCExporterUIOverride/IFCExportConfiguration.cs

-4
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,6 @@ public KnownERNames ExchangeRequirement {
338338
/// <summary>
339339
/// Id of the active view.
340340
/// </summary>
341-
[ScriptIgnore]
342341
public int ActiveViewId { get; set; } = ElementId.InvalidElementId.IntegerValue;
343342

344343
private bool m_isBuiltIn = false;
@@ -348,7 +347,6 @@ public KnownERNames ExchangeRequirement {
348347
/// <summary>
349348
/// Whether the configuration is builtIn or not.
350349
/// </summary>
351-
[ScriptIgnore]
352350
public bool IsBuiltIn
353351
{
354352
get
@@ -360,7 +358,6 @@ public bool IsBuiltIn
360358
/// <summary>
361359
/// Whether the configuration is in-session or not.
362360
/// </summary>
363-
[ScriptIgnore]
364361
public bool IsInSession
365362
{
366363
get
@@ -570,7 +567,6 @@ public void UpdateOptions(IFCExportOptions options, ElementId filterViewId)
570567
/// <summary>
571568
/// Identifies the version selected by the user.
572569
/// </summary>
573-
[ScriptIgnore]
574570
public String FileVersionDescription
575571
{
576572
get

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("22.3.0.0")]
70-
[assembly: AssemblyFileVersion("22.3.0.0")]
69+
[assembly: AssemblyVersion("22.4.0.0")]
70+
[assembly: AssemblyFileVersion("22.4.0.0")]
7171
#endif

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("22.3.0.0")]
17-
[assembly: AssemblyFileVersion("22.3.0.0")]
16+
[assembly: AssemblyVersion("22.4.0.0")]
17+
[assembly: AssemblyFileVersion("22.4.0.0")]
1818
#endif
1919

2020

Source/Revit.IFC.Common/Utility/IFCAnyHandleUtil.cs

+29-6
Original file line numberDiff line numberDiff line change
@@ -256,12 +256,20 @@ public static void EventClear()
256256
public static string GetIFCEntityTypeName(IFCEntityType entityType)
257257
{
258258
string entityTypeName;
259-
if (!m_sIFCEntityTypeToNames.TryGetValue(entityType, out entityTypeName))
259+
try
260260
{
261-
entityTypeName = entityType.ToString();
262-
m_sIFCEntityTypeToNames[entityType] = entityTypeName;
261+
if (!m_sIFCEntityTypeToNames.TryGetValue(entityType, out entityTypeName))
262+
{
263+
entityTypeName = entityType.ToString();
264+
m_sIFCEntityTypeToNames[entityType] = entityTypeName;
265+
}
266+
return entityTypeName;
267+
}
268+
269+
catch
270+
{
271+
return null;
263272
}
264-
return entityTypeName;
265273
}
266274

267275
/// <summary>
@@ -1239,7 +1247,14 @@ public static void SetAttribute(IFCAnyHandle handle, string name, IFCData value)
12391247
/// <returns>The collection of attribute values.</returns>
12401248
public static T GetValidAggregateInstanceAttribute<T>(IFCAnyHandle handle, string name) where T : ICollection<IFCAnyHandle>, new()
12411249
{
1242-
IFCData ifcData = handle.GetAttribute(name);
1250+
IFCData ifcData = null;
1251+
try
1252+
{
1253+
ifcData = handle.GetAttribute(name);
1254+
}
1255+
catch
1256+
{
1257+
}
12431258

12441259
T aggregateAttribute = default(T);
12451260

@@ -1975,7 +1990,15 @@ public static bool IsSubTypeOf(IFCAnyHandle handle, IFCEntityType type)
19751990
/// <returns>True if the handle entity is an entity of either the given type or one of its sub-types.</returns>
19761991
public static bool IsValidSubTypeOf(IFCAnyHandle handle, IFCEntityType type)
19771992
{
1978-
return handle.IsSubTypeOf(GetIFCEntityTypeName(type));
1993+
try
1994+
{
1995+
return handle.IsSubTypeOf(GetIFCEntityTypeName(type));
1996+
1997+
}
1998+
catch
1999+
{
2000+
return false;
2001+
}
19792002
}
19802003

19812004
/// <summary>

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

+10-1
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,16 @@ private static IFCAnyHandle CreateBeamAxis(ExporterIFC exporterIFC, Element elem
218218
IList<IFCAnyHandle> axis_items = null;
219219
if (ExporterCacheManager.ExportOptionsCache.ExportAs4ReferenceView)
220220
{
221-
IFCAnyHandle axisHnd = GeometryUtil.CreatePolyCurveFromCurve(exporterIFC, curve);
221+
IFCAnyHandle axisHnd;
222+
try
223+
{
224+
axisHnd = GeometryUtil.CreatePolyCurveFromCurve(exporterIFC, curve);
225+
}
226+
catch
227+
{
228+
axisHnd = GeometryUtil.OutdatedCreatePolyCurveFromCurve(exporterIFC, curve);
229+
}
230+
222231
axis_items = new List<IFCAnyHandle>();
223232
if (!IFCAnyHandleUtil.IsNullOrHasNoValue(axisHnd))
224233
{

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

+5-10
Original file line numberDiff line numberDiff line change
@@ -151,19 +151,14 @@ public void AddMaterial(ElementId matId)
151151

152152
/// <summary>
153153
/// Add the pair of component category name and material id pair
154-
/// This function also does AddMaterial(). Only use either AddMaterial if no component category needed, or this is Component Category is needed
155154
/// </summary>
156-
/// <param name="componentCategory">The Component Category name</param>
157155
/// <param name="materialId">The material id</param>
158-
public void AddRepresentationItemInfo(Document document, GeometryObject geomObject, ElementId materialId, IFCAnyHandle repItem)
156+
public void AddRepresentationItemInfo(Document document, GraphicsStyle style, ElementId materialId, IFCAnyHandle repItem)
159157
{
160-
GraphicsStyle graphicsStyle = document.GetElement(geomObject.GraphicsStyleId) as GraphicsStyle;
161-
string catName = null;
162-
if (graphicsStyle != null && graphicsStyle.GraphicsStyleCategory != null)
163-
{
164-
catName = graphicsStyle.GraphicsStyleCategory.Name; // set with the proper category name if any
165-
}
166-
else
158+
// Set with the proper category name if any
159+
string catName = style?.GraphicsStyleCategory?.Name;
160+
161+
if (catName == null)
167162
{
168163
Material material = document.GetElement(materialId) as Material;
169164
catName = (material != null) ? NamingUtil.GetMaterialName(material) : "<Unnamed>"; // Default name to the Material name if not null or <Unnamed>

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

+45-13
Original file line numberDiff line numberDiff line change
@@ -1119,7 +1119,17 @@ private static IFCAnyHandle CreateEdgeCurveFromCurve(IFCFile file, ExporterIFC e
11191119
bool sameSense, IDictionary<IFCFuzzyXYZ, IFCAnyHandle> cartesianPoints)
11201120
{
11211121
bool allowAdvancedCurve = ExporterCacheManager.ExportOptionsCache.ExportAs4;
1122-
IFCAnyHandle baseCurve = GeometryUtil.CreateIFCCurveFromRevitCurve(file, exporterIFC, curve, allowAdvancedCurve, cartesianPoints);
1122+
1123+
IFCAnyHandle baseCurve;
1124+
try
1125+
{
1126+
baseCurve = GeometryUtil.CreateIFCCurveFromRevitCurve(file, exporterIFC, curve, allowAdvancedCurve, cartesianPoints);
1127+
1128+
}
1129+
catch
1130+
{
1131+
baseCurve = GeometryUtil.OutdatedCreateIFCCurveFromRevitCurve(file, exporterIFC, curve, allowAdvancedCurve, cartesianPoints);
1132+
}
11231133

11241134
if (IFCAnyHandleUtil.IsNullOrHasNoValue(baseCurve))
11251135
return null;
@@ -1132,7 +1142,17 @@ private static IFCAnyHandle CreateProfileCurveFromCurve(IFCFile file, ExporterIF
11321142
IDictionary<IFCFuzzyXYZ, IFCAnyHandle> cartesianPoints, Transform additionalTrf = null)
11331143
{
11341144
bool allowAdvancedCurve = ExporterCacheManager.ExportOptionsCache.ExportAs4;
1135-
IFCAnyHandle ifcCurve = GeometryUtil.CreateIFCCurveFromRevitCurve(file, exporterIFC, curve, allowAdvancedCurve, cartesianPoints, additionalTrf);
1145+
1146+
IFCAnyHandle ifcCurve;
1147+
try
1148+
{
1149+
ifcCurve = GeometryUtil.CreateIFCCurveFromRevitCurve(file, exporterIFC, curve, allowAdvancedCurve, cartesianPoints, additionalTrf);
1150+
}
1151+
catch
1152+
{
1153+
ifcCurve = GeometryUtil.OutdatedCreateIFCCurveFromRevitCurve(file, exporterIFC, curve, allowAdvancedCurve, cartesianPoints, additionalTrf);
1154+
}
1155+
11361156
IFCAnyHandle sweptCurve = null;
11371157

11381158
bool isBound = false;
@@ -2677,7 +2697,8 @@ private static BodyData ExportBodyAsBRep(ExporterIFC exporterIFC, IList<Geometry
26772697
{
26782698
currentFaceHashSetList.Add(facetHnds);
26792699
alreadyExported = true;
2680-
bodyData.AddRepresentationItemInfo(document, geomObject, materialId, sweptSolidExporter.RepresentationItem);
2700+
GraphicsStyle style = document.GetElement(geomObject.GraphicsStyleId) as GraphicsStyle;
2701+
bodyData.AddRepresentationItemInfo(document, style, materialId, sweptSolidExporter.RepresentationItem);
26812702
}
26822703
}
26832704

@@ -2691,7 +2712,8 @@ private static BodyData ExportBodyAsBRep(ExporterIFC exporterIFC, IList<Geometry
26912712
alreadyExported = true;
26922713
hasAdvancedBrepGeometry = true;
26932714
CreateSurfaceStyleForRepItem(exporterIFC, document, options.CreatingVoid, advancedBrepBodyItem, materialId);
2694-
bodyData.AddRepresentationItemInfo(document, geomObject, materialId, advancedBrepBodyItem);
2715+
GraphicsStyle style = document.GetElement(geomObject.GraphicsStyleId) as GraphicsStyle;
2716+
bodyData.AddRepresentationItemInfo(document, style, materialId, advancedBrepBodyItem);
26952717
}
26962718
}
26972719

@@ -2704,10 +2726,11 @@ private static BodyData ExportBodyAsBRep(ExporterIFC exporterIFC, IList<Geometry
27042726
IList<IFCAnyHandle> triangulatedBodyItems = ExportBodyAsTessellatedFaceSet(exporterIFC, element, options, geomObject, trfToUse);
27052727
if (triangulatedBodyItems != null && triangulatedBodyItems.Count > 0)
27062728
{
2729+
GraphicsStyle style = document.GetElement(geomObject.GraphicsStyleId) as GraphicsStyle;
27072730
foreach (IFCAnyHandle triangulatedBodyItem in triangulatedBodyItems)
27082731
{
27092732
bodyItems.Add(triangulatedBodyItem);
2710-
bodyData.AddRepresentationItemInfo(document, geomObject, materialId, triangulatedBodyItem);
2733+
bodyData.AddRepresentationItemInfo(document, style, materialId, triangulatedBodyItem);
27112734
}
27122735
alreadyExported = true;
27132736
hasTriangulatedGeometry = true;
@@ -2821,21 +2844,26 @@ private static BodyData ExportBodyAsBRep(ExporterIFC exporterIFC, IList<Geometry
28212844
int size = currentFaceHashSetList.Count;
28222845
if (exportAsBReps)
28232846
{
2824-
int matToUse = -1;
2847+
int brepIndex = -1;
2848+
ElementId currMatId = ElementId.InvalidElementId;
2849+
GraphicsStyle currStyle = null;
28252850
for (int ii = 0; ii < size; ii++)
28262851
{
2827-
if (startIndexForObject[matToUse + 1] == ii)
2828-
matToUse++;
2852+
if (startIndexForObject[brepIndex + 1] == ii)
2853+
{
2854+
brepIndex++;
2855+
currMatId = materialIds[brepIndex];
2856+
currStyle = document.GetElement(splitGeometryList[brepIndex].GraphicsStyleId) as GraphicsStyle;
2857+
}
28292858
HashSet<IFCAnyHandle> currentFaceHashSet = currentFaceHashSetList[ii];
2830-
ElementId currMatId = materialIds[matToUse];
2831-
28322859
IFCAnyHandle faceOuter = IFCInstanceExporter.CreateClosedShell(file, currentFaceHashSet);
28332860
IFCAnyHandle brepHnd = RepresentationUtil.CreateFacetedBRep(exporterIFC, document,
28342861
options.CreatingVoid, faceOuter, currMatId);
28352862

28362863
if (!IFCAnyHandleUtil.IsNullOrHasNoValue(brepHnd))
28372864
{
28382865
bodyItems.Add(brepHnd);
2866+
bodyData.AddRepresentationItemInfo(document, currStyle, currMatId, brepHnd);
28392867
}
28402868
}
28412869
}
@@ -3123,7 +3151,8 @@ public static BodyData ExportBody(ExporterIFC exporterIFC,
31233151
materialIdsForExtrusions.Add(matId);
31243152
if (matId != ElementId.InvalidElementId)
31253153
{
3126-
bodyData.AddRepresentationItemInfo(document, geometryList[0], matId, extrusionData.BaseRepresentationItems[0]);
3154+
GraphicsStyle style = document.GetElement(geometryList[0].GraphicsStyleId) as GraphicsStyle;
3155+
bodyData.AddRepresentationItemInfo(document, style, matId, extrusionData.BaseRepresentationItems[0]);
31273156
}
31283157
bodyData.RepresentationHnd = extrusionData.Handle;
31293158
bodyData.ShapeRepresentationType = extrusionData.ShapeRepresentationType;
@@ -3308,7 +3337,9 @@ public static BodyData ExportBody(ExporterIFC exporterIFC,
33083337
}
33093338
exportedAsExtrusion = true;
33103339
hasExtrusions = true;
3311-
bodyData.AddRepresentationItemInfo(document, geometryList[geomIndex], matId, extrusionHandle);
3340+
GraphicsStyle style = document.GetElement(geometryList[geomIndex].GraphicsStyleId) as GraphicsStyle;
3341+
3342+
bodyData.AddRepresentationItemInfo(document, style, matId, extrusionHandle);
33123343
}
33133344
}
33143345

@@ -3363,7 +3394,8 @@ public static BodyData ExportBody(ExporterIFC exporterIFC,
33633394
bodyItems.Add(sweptHandle);
33643395
ElementId matId = exporterIFC.GetMaterialIdForCurrentExportState();
33653396
materialIdsForExtrusions.Add(matId);
3366-
bodyData.AddRepresentationItemInfo(document, solid, matId, sweptHandle);
3397+
GraphicsStyle style = document.GetElement(solid.GraphicsStyleId) as GraphicsStyle;
3398+
bodyData.AddRepresentationItemInfo(document, style, matId, sweptHandle);
33673399
exported = true;
33683400
hasRepresentationType = sweptSolidExporter.RepresentationType;
33693401

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

+10-1
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,16 @@ public static void ExportCurveElement(ExporterIFC exporterIFC, CurveElement curv
154154
List<Curve> curvesFromGeomElem = GeometryUtil.GetCurvesFromGeometryElement(geometryElement);
155155
foreach (Curve curve in curvesFromGeomElem)
156156
{
157-
IFCAnyHandle curveHnd = GeometryUtil.CreatePolyCurveFromCurve(exporterIFC, curve, trf);
157+
IFCAnyHandle curveHnd;
158+
try
159+
{
160+
curveHnd = GeometryUtil.CreatePolyCurveFromCurve(exporterIFC, curve, trf);
161+
}
162+
catch
163+
{
164+
curveHnd = GeometryUtil.OutdatedCreatePolyCurveFromCurve(exporterIFC, curve, trf);
165+
}
166+
158167
if (!IFCAnyHandleUtil.IsNullOrHasNoValue(curveHnd))
159168
curves.Add(curveHnd);
160169
}

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

+10-1
Original file line numberDiff line numberDiff line change
@@ -1874,7 +1874,16 @@ public static IFCAnyHandle CreateSurfaceOfLinearExtrusionFromCurve(ExporterIFC e
18741874
// A list of IfcCurve entities.
18751875
if (ExporterCacheManager.ExportOptionsCache.ExportAs4ReferenceView)
18761876
{
1877-
IFCAnyHandle curveHnd = GeometryUtil.CreatePolyCurveFromCurve(exporterIFC, baseCurve, extrusionLCS, extrusionDir);
1877+
IFCAnyHandle curveHnd;
1878+
try
1879+
{
1880+
curveHnd = GeometryUtil.CreatePolyCurveFromCurve(exporterIFC, baseCurve, extrusionLCS, extrusionDir);
1881+
}
1882+
catch
1883+
{
1884+
curveHnd = GeometryUtil.OutdatedCreatePolyCurveFromCurve(exporterIFC, baseCurve, extrusionLCS, extrusionDir);
1885+
}
1886+
18781887
profileCurves = new List<IFCAnyHandle>();
18791888
if (!IFCAnyHandleUtil.IsNullOrHasNoValue(curveHnd))
18801889
profileCurves.Add(curveHnd);

0 commit comments

Comments
 (0)