Skip to content

fix for #2386, using point on element (building coder sample)#2781

Merged
jmcouffin merged 2 commits intopyrevitlabs:developfrom
Wurschdhaud:fix-for-#2386
Sep 1, 2025
Merged

fix for #2386, using point on element (building coder sample)#2781
jmcouffin merged 2 commits intopyrevitlabs:developfrom
Wurschdhaud:fix-for-#2386

Conversation

@Wurschdhaud
Copy link
Copy Markdown
Contributor

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:

  • Code follows the PEP 8 style guide.
  • Code has been formatted with Black using the command:
    pipenv run black {source_file_or_directory}
  • Changes are tested and verified to work as expected. - Revit 2024

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! 🎉

Copy link
Copy Markdown
Contributor

@devloai devloai bot left a comment

Choose a reason for hiding this comment

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

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:

  • @devloai fix the identified null reference issues
  • @devloai test the fix with both loaded and unloaded linked documents

@jmcouffin
Copy link
Copy Markdown
Contributor

great!
Thanks @Wurschdhaud

@jmcouffin jmcouffin merged commit c5f36c9 into pyrevitlabs:develop Sep 1, 2025
@Wurschdhaud Wurschdhaud deleted the fix-for-#2386 branch September 1, 2025 17:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

"Orient Section Box to Face" works with Linked files

2 participants