fix(Revit): CNX-8655 - handle FabricationPart host retrieval #3120
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.
Description & motivation
This commit refactors the
RevitCommitObjectBuilder
class to handle the retrieval of a FabricationPart's associated host element. It introduces a new private method,HandleFabricationPart
, which processes aFabricationPart
and returns its host element. The method checks if theFabricationPart
has a host and retrieves it using theGetHostedInfo()
method.The prior code would pass
null
fromGetHostedInfo()
intoGetElement()
which threw from deep withing the Revit APIScreenshots:
Before:

After:

Validation of changes:
Manual testing with provided test file.
Checklist: