Skip to content

dev/#2606 Fix for orienting section box to faces of objects that have transformations#2619

Merged
jmcouffin merged 4 commits intopyrevitlabs:developfrom
Wurschdhaud:develop
Mar 31, 2025
Merged

dev/#2606 Fix for orienting section box to faces of objects that have transformations#2619
jmcouffin merged 4 commits intopyrevitlabs:developfrom
Wurschdhaud:develop

Conversation

@Wurschdhaud
Copy link
Copy Markdown
Contributor

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:

  • 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.

Related Issues


Additional Notes

Tested in Revit 2024.


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

@jmcouffin jmcouffin merged commit 830bba6 into pyrevitlabs:develop Mar 31, 2025
@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 5.0.1.25090+0650-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 5.0.1.25090+0707-wip

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 2, 2025

📦 New work-in-progress (wip) builds are available for 5.0.1.25092+0954-wip

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 3, 2025

📦 New work-in-progress (wip) builds are available for 5.0.1.25093+2001-wip

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 4, 2025

📦 New work-in-progress (wip) builds are available for 5.0.1.25094+0703-wip

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 4, 2025

📦 New work-in-progress (wip) builds are available for 5.0.1.25094+0800-wip

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 4, 2025

📦 New work-in-progress (wip) builds are available for 5.0.1.25094+0926-wip

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 4, 2025

📦 New work-in-progress (wip) builds are available for 5.1.0.25094+0940-wip

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 4, 2025

📦 New public release are available for 5.1.0.25094+1133

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 4, 2025

📦 New public release are available for 5.1.0.25094+1133

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 4, 2025

📦 New public release are available for 5.1.0.25094+1133

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.

[Bug]: The Orient section box and view to face commands do not work for objects which have transformations

2 participants