Skip to content

proposed tool: sectionbox navigator#2881

Merged
jmcouffin merged 8 commits intopyrevitlabs:developfrom
Wurschdhaud:new-tool-sectionbox-navigator
Oct 28, 2025
Merged

proposed tool: sectionbox navigator#2881
jmcouffin merged 8 commits intopyrevitlabs:developfrom
Wurschdhaud:new-tool-sectionbox-navigator

Conversation

@Wurschdhaud
Copy link
Copy Markdown
Contributor

@Wurschdhaud Wurschdhaud commented Oct 23, 2025

Description

During design I work exclusively with 3D views and sectionboxes to cut them accordingly.
Therefore I use the tools:

  • pyRevit-toggles-section box
  • pyRevit-modify-3D-section box align
  • pyRevit-preflight-level data
  • COINS sectionbox

a lot.
I am proposing this little helper tool, combining features and providing previews (thanks for the hint @tay0thman , @thumDer ) using dc3d

image
sbnavigator.mp4

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

If applicable, link the issues resolved by this pull request:

  • Resolves #[issue number]

Additional Notes

Code: heavily AI supported, please review!
Feature set - AI generated:

Section Box Navigator - Feature Description

Overview

A comprehensive, modeless WPF window for intuitive section box navigation and manipulation in Revit 3D views. This tool provides real-time visual feedback and streamlines the workflow for adjusting section boxes during model coordination and documentation.

Key Features

1. Real-Time Status Display

  • Shows current section box top and bottom positions in project units
  • Displays the next level above/below each boundary with elevation information
  • Automatically updates when section box is modified through any method
  • Persists across view changes and manual adjustments

2. Level-Based Navigation

  • Top/Bottom Controls: Snap the top or bottom of the section box to the next level up or down
  • Box Movement: Move the entire section box up or down while maintaining its height
  • Intelligent validation prevents creating invalid boxes (e.g., moving top below bottom)
  • Perfect for quickly isolating specific floors or building sections

3. Precise Nudging

  • Fine-tune section box boundaries by a specified distance
  • Separate controls for top and bottom adjustments
  • User-defined nudge amount with automatic unit conversion
  • Independent up/down arrows for incremental adjustments
  • Ideal for exposing MEP elements just above ceilings or below floors

4. Expand/Shrink Functionality

  • Uniformly expand or shrink the section box in all directions (X, Y, Z)
  • Maintains the box center point while growing/shrinking
  • Works with rotated section boxes (respects local coordinate system)
  • User-defined expansion amount with automatic unit conversion
  • Perfect for quick context adjustments or focusing on specific areas

5. Interactive Preview System

  • Real-time semi-transparent preview mesh on button hover
  • Shows exactly how the section box will change before committing
  • Color-coded preview (blue with transparency) clearly distinguishes from actual box
  • Works for all operations: level snapping, nudging, and expand/shrink
  • Can be toggled on/off for performance or preference
  • Powered by DC3D server for smooth visualization

6. Section Box Persistence

  • Toggle Box: Temporarily hide the section box while preserving its configuration
  • Automatically saves section box state per view using pyRevit data files
  • Restore previously saved section boxes with a single click
  • Survives Revit sessions and model reloads
  • Essential for switching between full and sectioned views during coordination

7. Visibility Management

  • Hide/Unhide Box: Toggle the visibility of the section box crop region itself
  • Uses Revit's reveal hidden mode for safe manipulation
  • Useful for creating clean screenshots and presentations

8. Align to Face

  • Intelligent face picker for aligning section box orientation
  • Works with both model elements and linked models
  • Automatically rotates section box perpendicular to selected face
  • Maintains box position while updating orientation
  • Essential for diagonal walls, rotated grids, and complex geometries

9. Unit System Integration

  • Automatically detects and uses project units
  • Displays units clearly in the interface
  • All inputs and outputs respect project unit formatting
  • Seamlessly works with Metric and Imperial projects

10. Modeless Operation

  • Window stays on top and accessible while working in Revit
  • Continues to function while navigating views and selecting elements
  • Non-blocking design allows normal Revit operations
  • Clean external event pattern for thread-safe Revit API operations

Technical Highlights

  • Event-Driven Updates: Monitors document changes to update display automatically
  • Transaction Safety: All modifications wrapped in proper transactions
  • Error Handling: Comprehensive validation and user-friendly error messages
  • Memory Management: Proper cleanup on window close (DC3D server, event handlers)
  • Cross-Version Compatible: Uses pyRevit compatibility layer for ElementId handling
  • Serialization: Pickle-based storage for section box persistence

Use Cases

  1. MEP Coordination: Quickly adjust section boxes to expose services above/below levels
  2. Structural Analysis: Isolate specific floors or bays for detailed review
  3. Presentation Views: Fine-tune section cuts for client presentations
  4. Clash Detection: Adjust viewing volumes during coordination meetings
  5. Documentation: Create consistent section views aligned to building geometry
  6. Model Review: Rapidly navigate through building sections during quality control

User Experience Benefits

  • Speed: Replace multiple clicks and parameter inputs with single button presses
  • Accuracy: Visual preview prevents errors and rework
  • Flexibility: Combines level-based and precise numeric control
  • Confidence: See changes before applying them
  • Consistency: Standardized section box adjustments across project team

Thank you for contributing to pyRevit! 🎉

@devloai
Copy link
Copy Markdown
Contributor

devloai bot commented Oct 23, 2025

Unable to perform a code review. You have run out of credits 😔
Please upgrade your plan or buy additional credits from the subscription page.

@jmcouffin
Copy link
Copy Markdown
Contributor

very very very cool tool
the level up/down ❤️

@Wurschdhaud
Copy link
Copy Markdown
Contributor Author

Once there's stuff to add (and if it should be accepted to the repo), I just though of another neat thing:
image

aligning with a 2D views cropbox and viewrange

@tay0thman
Copy link
Copy Markdown
Contributor

this is ridiculously good! I'll test it shortly.

@jmcouffin
Copy link
Copy Markdown
Contributor

from @tay0thman

@Wurschdhaud
The 500 default nudge value is excessive for Imperial dimensions, can you run a unit convert function based on the model units, so in EU = 500cm should equal around 16 feet or so.

image

@jmcouffin
Copy link
Copy Markdown
Contributor

You are right @tay0thman
that would be cool if the ui and backend could take care of the conversion based on the projects unit.
a killer tool

- support for sectionbox from 2d view (currently only floor, may be extended)
- better error handling for non 3D views
- subscribe to view changed event
- tried to make it more readable/maintainable with helper functions, to be extended (?)
@Wurschdhaud
Copy link
Copy Markdown
Contributor Author

done. also:

  • added support for box creation from 2D views
  • cleaned up some stuff + added error handling when not on 3d views

Wurschdhaud and others added 5 commits October 27, 2025 15:58
- use lib command for pickling
- use updated query.get_geometry() with detaillevel
… Added checks for nudge and expansion amounts, ensuring valid input and improved user feedback. Updated exception logging for better debugging. Cleaned up comments and formatting for clarity.
@jmcouffin jmcouffin added Tools Issues related to pyRevit commands [subsystem] Highlight Highlight these issues on Release notes labels Oct 28, 2025
@jmcouffin jmcouffin merged commit 0bb95c7 into pyrevitlabs:develop Oct 28, 2025
@jmcouffin
Copy link
Copy Markdown
Contributor

Very complete, comprehensive. This will become one of the most loved tool for sure... We need to advertise it properly in next release.
Great job @Wurschdhaud

@Wurschdhaud Wurschdhaud deleted the new-tool-sectionbox-navigator branch October 28, 2025 15:27
@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 5.2.0.25301+1521-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 5.2.0.25302+0921-wip

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 5.2.0.25302+0949-wip

@Wurschdhaud
Copy link
Copy Markdown
Contributor Author

Very complete, comprehensive. This will become one of the most loved tool for sure... We need to advertise it properly in next release. Great job @Wurschdhaud

Just out of curiosity @jmcouffin :
How do changelogs get generated? Completely manual, script and tags for PRs or AI comparing all commits and generating a summary?

@jmcouffin
Copy link
Copy Markdown
Contributor

script and tags for PRs

if you look at the workflow for the CI, you can see how it is down and which routine is being called: from here

- name: Commit & Tag Changes (Release)

@github-actions
Copy link
Copy Markdown
Contributor

📦 New work-in-progress (wip) builds are available for 5.2.0.25302+1503-wip

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Nov 3, 2025

📦 New work-in-progress (wip) builds are available for 5.2.0.25307+1644-wip

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Nov 3, 2025

📦 New work-in-progress (wip) builds are available for 5.2.0.25307+1935-wip

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Nov 3, 2025

📦 New work-in-progress (wip) builds are available for 5.2.0.25307+2011-wip

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Nov 3, 2025

📦 New work-in-progress (wip) builds are available for 5.2.0.25307+2045-wip

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Nov 3, 2025

📦 New work-in-progress (wip) builds are available for 5.3.0.25307+2237-wip

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Nov 4, 2025

📦 New work-in-progress (wip) builds are available for 5.3.0.25308+0721-wip

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Nov 4, 2025

📦 New public release are available for 5.3.0.25307+2146

@OxyzenDigital
Copy link
Copy Markdown

Amazing! If we could also add hopping between Grid to Grid, Level to Level in fixed position, it would become a great validation tool. As general contractors reviewing the congregated models, 3D section box is an important tool and visual integrity at Grid lines and Level intersections are of prime value.

@jmcouffin
Copy link
Copy Markdown
Contributor

@Wurschdhaud ;p
great suggestion @OxyzenDigital

@Wurschdhaud
Copy link
Copy Markdown
Contributor Author

Cool idea. Will look into it, I think I know how to tackle it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Highlight Highlight these issues on Release notes Tools Issues related to pyRevit commands [subsystem]

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants