dev/#2606 Fix for orienting section box to faces of objects that have transformations#2619
Conversation
There was a problem hiding this comment.
PR Summary:
This PR fixes an issue with orienting section boxes for family instances with transformations. The solution properly handles face normals in transformed objects (e.g., rotated generic models) by obtaining the transformation of the family instance and converting local coordinates to world coordinates correctly. This approach ensures that section boxes align properly regardless of how elements are positioned in 3D space.
Review Summary:
The code changes effectively address the issue and are technically sound. The approach of applying the element's transformation to convert local face normals to world coordinates is appropriate. I've noted just a couple of minor cleanups that would improve the code quality. Feel free to provide feedback on this review which I'll consider for future reviews.
Follow-up suggestions:
@devloai apply the suggested changes
...tension/pyRevit.tab/Modify.panel/3D.pulldown/Orient Section Box To Face.pushbutton/script.py
Outdated
Show resolved
Hide resolved
...tension/pyRevit.tab/Modify.panel/3D.pulldown/Orient Section Box To Face.pushbutton/script.py
Outdated
Show resolved
Hide resolved
|
📦 New work-in-progress (wip) builds are available for 5.0.1.25090+0650-wip |
|
📦 New work-in-progress (wip) builds are available for 5.0.1.25090+0707-wip |
|
📦 New work-in-progress (wip) builds are available for 5.0.1.25092+0954-wip |
|
📦 New work-in-progress (wip) builds are available for 5.0.1.25093+2001-wip |
|
📦 New work-in-progress (wip) builds are available for 5.0.1.25094+0703-wip |
|
📦 New work-in-progress (wip) builds are available for 5.0.1.25094+0800-wip |
|
📦 New work-in-progress (wip) builds are available for 5.0.1.25094+0926-wip |
|
📦 New work-in-progress (wip) builds are available for 5.1.0.25094+0940-wip |
|
📦 New public release are available for 5.1.0.25094+1133 |
|
📦 New public release are available for 5.1.0.25094+1133 |
|
📦 New public release are available for 5.1.0.25094+1133 |
Fixed orienting the section boxes for family instances
Description
The original code didn't work for families, that have been placed somewhere in open space, e.g. rotated generic models. Using this approach to take the object geometry instead of the face itself, transformation of the generic model can be obtained and taken into account.
I tried to use pyrevits pick_face(), but the reference of the face is always None when doing it that way. Not sure why.
Checklist
Before submitting your pull request, ensure the following requirements are met:
pipenv run black {source_file_or_directory}Related Issues
Additional Notes
Tested in Revit 2024.
Thank you for contributing to pyRevit! 🎉