Repository navigation
Seed legacy type-level material relation GlobalIds from material identity - #193
Merged
mahach666 merged 1 commit intoNov 12, 2026
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
In
IfcProfile.Legacy,AssociateTypeObjectMaterialsseeded theGlobalIdof type-levelIfcRelAssociatesMaterialentities from the STEP entity number of the relatingIfcMaterial,IfcMaterialListorIfcMaterialLayerSet(type-materials:{relatingMaterial}/type-layer-set:{layerSet}). Adding or removing unrelated elements or properties earlier in the file shifted those STEP#Nnumbers and changed theGlobalIdof every type-level material relation, even though product-level material relations (materials:{materialKey}andmaterial-layers:{group.Key}) already used stable Revit material/layer keys.Closes #88
Changes
(int EntityId, string Seed)inrelatingMaterialByProductEntity(materialKey, e.g."0","700","710,720") andlayerSetByProductEntity(ownType.TypeIdorgroup.Key).AssociateTypeObjectMaterialsrelationGlobalIds fromtype-materials:{materialSeed}andtype-layer-set:{layerSetSeed}instead of STEP entity IDs.ComponentType_ReceivesTheMaterialOfItsFirstInstance(type-materials:0) and addLegacyTypeMaterialRelationGlobalIds_StayStableWhenEarlierStepEntitiesShiftverifying single-material (IfcMaterial) and multi-material (IfcMaterialList) type-level relations stay identical when prepended elements/properties shift STEP entity IDs, whileIfcProfile.Currentkeeps its existingMD5("{projectGlobalId}IfcRelAssociatesMaterial:{firstRelatedGlobalId}")seed.GlobalIdchange for legacy type-level material relations under### Breaking changesinCHANGELOG.md.Export comparison
IfcProfile.Current(default) and JSON exports: byte-for-byte unchanged (ApplyCurrentMaterialRelationGlobalIdsrewrites material relationGlobalIds inCurrentprofile, and JSON exports do not touchIfcExporter).IfcProfile.Legacy: product-levelIfcRelAssociatesMaterialentities (materials:{materialKey},material-layers:{group.Key}) are unchanged; type-levelIfcRelAssociatesMaterialentities change theirGlobalIdonce fromIfcGuid.FromName("type-materials:<stepEntityId>")toIfcGuid.FromName("type-materials:<materialElementIds>")and remain stable across unrelated STEP entity shifts.Verification
dotnet build RvtIO.slnx -c Release— 0 errors, 0 warnings insrc/.dotnet test tests/RvtIO.Tests/RvtIO.Tests.csproj -c Release --no-build --filter "FullyQualifiedName~IfcExporterTypeObjectsTests|FullyQualifiedName~HostMaterialUsageTests|FullyQualifiedName~HostTypeLayerSetGroupingTests|FullyQualifiedName~IfcMepMaterialsTests"— 298 passed, 0 failed (net8.0andnet10.0). Private-fixture[SkippableFact]tests outside this filter are skipped whenRVTIO_TEST_FILESis unset.dotnet docfx docfx.json --warningsAsErrors— 0 warnings, 0 errors.