fix for #2386, using point on element (building coder sample)#2781
fix for #2386, using point on element (building coder sample)#2781jmcouffin merged 2 commits intopyrevitlabs:developfrom
Conversation
There was a problem hiding this comment.
PR Summary:
This PR fixes issue #2386 by enabling the "Orient Section Box to Face" tool to work with linked Revit files. The solution switches from direct face selection to point-on-element selection, following the Building Coder blog pattern. This approach handles both regular and linked elements through unified coordinate transformation logic.
Review Summary:
Reviewed the changes and identified 2 critical null reference vulnerabilities that could cause runtime crashes when working with linked documents. The core approach is sound and follows established pyRevit defensive programming patterns from the knowledge base. The coordinate transformation logic correctly handles both local and world coordinate systems.
Follow-up suggestions:
...tension/pyRevit.tab/Modify.panel/3D.pulldown/Orient Section Box To Face.pushbutton/script.py
Show resolved
Hide resolved
...tension/pyRevit.tab/Modify.panel/3D.pulldown/Orient Section Box To Face.pushbutton/script.py
Outdated
Show resolved
Hide resolved
|
great! |
Description
fixes #2386 using the sample on https://thebuildingcoder.typepad.com/blog/2012/05/selecting-a-face-in-a-linked-file.html
uses now a point as reference on both, linked and main hosted objects.
Checklist
Before submitting your pull request, ensure the following requirements are met:
pipenv run black {source_file_or_directory}Related Issues
If applicable, link the issues resolved by this pull request:
Additional Notes
Include any additional context, screenshots, or considerations for reviewers.
Thank you for contributing to pyRevit! 🎉