Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(Revit): CNX-8655 - handle FabricationPart host retrieval #3120

Merged
merged 1 commit into from
Jan 4, 2024

Conversation

jsdbroughton
Copy link
Contributor

@jsdbroughton jsdbroughton commented Jan 2, 2024

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 a FabricationPart and returns its host element. The method checks if the FabricationPart has a host and retrieves it using the GetHostedInfo() method.

The prior code would pass null from GetHostedInfo() into GetElement() which threw from deep withing the Revit API

Screenshots:

Before:
image

After:
image

Validation of changes:

Manual testing with provided test file.

Checklist:

  • My pull request follows the guidelines in the Contributing guide?
  • My pull request does not duplicate any other open Pull Requests for the same update/change?
  • My commits are related to the pull request and do not amend unrelated code or documentation.
  • My code follows a similar style to existing code.
  • I have added appropriate tests.
  • I have updated or added relevant documentation.

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 a `FabricationPart` and returns its host element. The method checks if the `FabricationPart` has a host and retrieves it using the `GetHostedInfo()` method.

The prior code would pass `null` from `GetHostedInfo()` into `GetElement()` which threw from deep withing the Revit API
@jsdbroughton jsdbroughton self-assigned this Jan 2, 2024
@jsdbroughton jsdbroughton added bug Something isn't working revit issues related to the revit connector. labels Jan 2, 2024
@jsdbroughton jsdbroughton marked this pull request as ready for review January 2, 2024 17:51
@@ -223,6 +223,19 @@ private static string GetCategoryId(Base conversionResult, Element revitElement)
};
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, in the context of our discord chat the other day, this is much nicer to read, especially given where we are consuming it as single lines

@jsdbroughton jsdbroughton merged commit 49e6c8d into dev Jan 4, 2024
30 checks passed
@jsdbroughton jsdbroughton deleted the CNX-8655-MEP-Fabrication-Ductwork-not-converting branch January 4, 2024 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working revit issues related to the revit connector.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants