-
-
Notifications
You must be signed in to change notification settings - Fork 405
tool: Improved overall tool functionality - ViewRange #2865
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
Conversation
Added offset and level change directly in UI
There was a problem hiding this 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 significantly enhances the ViewRange tool by adding the ability to modify view range planes. Key additions include:
- New UI controls for editing offset values and selecting levels for each plane
- Validation logic to ensure proper elevation ordering (Top ≥ Cut ≥ Bottom ≥ ViewDepth)
- Support for "Unlimited" level settings
- Apply and Reset button handlers for user modifications
- Better view template detection and read-only state management
Review Summary:
Identified 4 critical bugs that need to be addressed before merge. The main issues involve state management in the singleton Context pattern, causing the "Reset" functionality to restore incorrect values when switching between views. Additionally, there are document reference bugs and IronPython-specific stale global state issues that violate established patterns per the review validation checklist.
The functionality design is solid with good validation logic, but the state persistence issues will cause confusing user experiences where reset doesn't work as expected after view changes.
Follow-up suggestions:
@devloai fix the identified state management and document reference issues@devloai verify the XAML file has the necessary UI controls for the new functionality
...RevitTools.extension/pyRevit.tab/Toggles.panel/toggles3.stack/ViewRange.pushbutton/script.py
Outdated
Show resolved
Hide resolved
...RevitTools.extension/pyRevit.tab/Toggles.panel/toggles3.stack/ViewRange.pushbutton/script.py
Show resolved
Hide resolved
...RevitTools.extension/pyRevit.tab/Toggles.panel/toggles3.stack/ViewRange.pushbutton/script.py
Outdated
Show resolved
Hide resolved
...RevitTools.extension/pyRevit.tab/Toggles.panel/toggles3.stack/ViewRange.pushbutton/script.py
Show resolved
Hide resolved
...RevitTools.extension/pyRevit.tab/Toggles.panel/toggles3.stack/ViewRange.pushbutton/script.py
Outdated
Show resolved
Hide resolved
...RevitTools.extension/pyRevit.tab/Toggles.panel/toggles3.stack/ViewRange.pushbutton/script.py
Outdated
Show resolved
Hide resolved
|
I've just realized that his is related to #2866. Why are they 2 separate PRs? |
These should be together, this is my mistake |
|
Not completely related, but since there is some refactoring going on: |
…ggles3.stack/ViewRange.pushbutton/script.py Co-authored-by: devloai[bot] <168258904+devloai[bot]@users.noreply.github.com>
…ggles3.stack/ViewRange.pushbutton/script.py Co-authored-by: devloai[bot] <168258904+devloai[bot]@users.noreply.github.com>
|
so I think with the #2888 you should be able to do sth like: from pyrevit.revit import events
@events.handle("selection-changed")
def do_stuff():
#does stuff in case of eventand at the end in your form closed thingi: events.stop_events() |
…UI with new layout and input fields for plane elevations and associated levels. Added functionality for applying changes and resetting values, along with warning messages for user feedback.
@Wurschdhaud You may want to help and make it happen here. |
… Increased width of UI elements for better layout, added text wrapping for headers, and improved event management by replacing manual subscription with decorators. Enhanced document reference handling to ensure valid view context.
|
I saw you already added it @jmcouffin ? Skimming through i noticed:
I just played a round with it for a bit, didn't run into any issues. |
|
@Wurschdhaud usually, a basic checkout, commit to the PR branch is allowed. Give it a try. |
|
@Wurschdhaud I'm on it |
…anization. Replaced direct access to IntegerValue with a utility function for better compatibility. Updated PLANES definition to use OrderedDict for consistent ordering. Cleaned up unused imports and improved document reference handling.
|
Ok, good enough for tonight! |
|
📦 New work-in-progress (wip) builds are available for 5.2.0.25307+2011-wip |
|
📦 New work-in-progress (wip) builds are available for 5.2.0.25307+2045-wip |
|
additional fix in #2900 |
|
📦 New work-in-progress (wip) builds are available for 5.3.0.25307+2237-wip |
|
📦 New work-in-progress (wip) builds are available for 5.3.0.25308+0721-wip |
|
📦 New public release are available for 5.3.0.25307+2146 |




Improved overall tool functionality
Description
This pull request enhances the ViewRange tool's user experience by improving interface:
Key Improvements:
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
User Impact:
Thank you for contributing to pyRevit! 🎉