Not possible to record Guid of IfcDoorStyle after export
- Dominant language
- C#
- Stars
- 637
- Forks
- 225
- PR merge metrics
- No merged PRs in 30d
Description
If a wall is exported with the "Store the IFC GUID in an element parameter after export" enabled, then an `IfcGUID` and `Type IfcGUID` is created. For a wall, these correspond to the `IfcWall.GlobalId` and `IfcWallType.GlobalId` respectively.
This doesn't apply for a few things, one example of which is doors, where `IfcDoorStyle.GlobalId` does not correlate with the `Type IfcGUID`.
I don't see a reason for this to be a case - at a glance I don't see a one (Revit) to many (IFC) mapping that warrants a `subIndex` for generating a GUID. Could be wrong - haven't looked deeply into it.
The practical problem that comes out of this is that when an IFC model is created, that IFC cannot be correlated back to the Revit model. Or vice versa. Or if a COBie spreadsheet is being produced where an `ExtIdentifier` column exists for the `Type` worksheet, it cannot be correlated back to the IFC model.
Relevant sources:
https://github.com/Autodesk/revit-ifc/blob/cd2551b77554a97d92f0605a72f28fee3a980039/Source/Revit.IFC.Export/Exporter/FamilyInstanceExporter.cs#L253-L259
https://github.com/Autodesk/revit-ifc/blob/897b3b1190e1ece816f6cddb5f7da432ae474b97/Source/Revit.IFC.Export/Toolkit/IFCSubElementEnums.cs#L92
https://github.com/Autodesk/revit-ifc/blob/897b3b1190e1ece816f6cddb5f7da432ae474b97/Source/Revit.IFC.Export/Utility/GUIDUtil.cs#L198 <-- not entirely sure what magic is happening in `ExporterIFCUtils.CreateSubElementGUID(element, subIndex)`, so I cannot reverse engineer this behaviour.
Contributor guide
Research direction
Start in Exporter/FamilyInstanceExporter.cs at the referenced export logic, then trace IFCSubElementEnums.cs and Utility/GUIDUtil.cs, especially ExporterIFCUtils.CreateSubElementGUID(element, subIndex). Reproduce the door export with GUID storage enabled and compare IfcDoorStyle.GlobalId with Type IfcGUID; done means the exported type can be correlated back to the Revit type.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100