-
Notifications
You must be signed in to change notification settings - Fork 175
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
Add filter to skip the modifying when the zone of space is null #3525
Add filter to skip the modifying when the zone of space is null #3525
Conversation
ItsPatrickHe
commented
Jun 19, 2024
•
edited
Loading
edited
- "Fix: This PR is made to fix this issue: Revit connector does not import spaces when the zone of space is null #3524
- 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.
@RobClaessensRHDHV tag you in the PR :) |
@connorivy Could you check this PR? We need this update in order to receive spaces in the project. Thanks in advance. |
Hey @ItsPatrickHe, Sorry for the delay on this quick fix. I need to familiarize myself with spaces and zones, but are you aware of what the 'CreateRevitZone' method is doing on line 155? It almost looks like that was the intended path for empty speckle zones (but then it's a bit confusing because we then try to assign it's name from the speckle zone) |
Thanks for the reply. I must say I'm also not that familar with the part of spaces and zones. To me this part seems to either convert the zone in the speckleSpace or create a revit zone if there is no name for the zone. But the last step to assign the name of the speckle zone again is a bit confusing. Could you ask around a bit maybe in your team? For us this simply will cause an error when you have null for the space zone, then getting name from speckleSpace.zone is impossible. |
Had a bit of a deep dive in this specific function, which seems to have several issues to it, which I appended in below code:
I've updated some parts of the function to the below, which at least fixes the issues above. It will only delete the specific Revit Space from the zone, and then only delete the full zone once no spaces are left. The conditional assignment has been reverted and zone name is only assigned if it's actually a valid name.
A remaining issue is the fact that it will create new zones for essentially all spaces. In our example, we initially have 15 spaces with the Default zone being assigned. After receiving, all spaces will be assigned with a new, distinct zone as can be seen below. This happens as the revitZone.Phase and targetPhase differ, creating a new zone for each space. It would definitely be more appropriate if one zone would be created for the specific targetPhase, to which other spaces will also be assigned afterwards. Anyway, I believe it at least addresses some of the issues with the existing code, though it can still be improved. |