Skip to content

Conversation

@Wurschdhaud
Copy link
Contributor

Description

  • add areaplan and 3d view
  • change mark element to also affect open views of selected categories, like unmark
  • store the current override if any to restore during unmark. previously custom per element overrides would be reset.

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:


Additional Notes

Include any additional context, screenshots, or considerations for reviewers.


Thank you for contributing to pyRevit! 🎉

…s, like unmark

- store the current override if any to restore during unmark
Copy link
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:

Fixes override graphics behavior in the renumber tool by:

  • Adding AreaPlan and ThreeD view types to get_open_views() to fix issue #2951
  • Changing marking to affect all open views instead of just the active view
  • Storing and restoring original element override states instead of resetting to defaults
  • Refactoring renumbered_element_ids from list to dict structure to track per-element, per-view overrides

Review Summary:

Found one critical bug in the door_by_room_renumber() function where the refactoring was incomplete - the data structure was changed from list to dict but the code still uses .append() which will cause a runtime crash. The main pick_and_renumber() logic is sound and correctly captures override states before marking. Also identified a performance optimization opportunity to reduce redundant API calls.

The core fix addresses the reported issue where elements remained visually marked in Area Plan views because those view types weren't included in the unmark operation.

Follow-up suggestions:

  • @devloai fix the identified issues - Address the critical bug in door_by_room_renumber and the performance optimization

@jmcouffin jmcouffin requested a review from Copilot December 6, 2025 22:22
@jmcouffin jmcouffin added the Tools Issues related to pyRevit commands [subsystem] label Dec 6, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR enhances the ReNumber tool's override graphics behavior by adding support for Area Plan and 3D views, applying visual marking across all open views (consistent with the unmark behavior), and preserving custom per-element override settings during the renumber/unmark cycle.

Key Changes

  • Extended view type support to include AreaPlan and ThreeD views
  • Modified marking behavior to apply across all open views instead of just the active view
  • Implemented override state preservation by storing original overrides before marking and restoring them during unmark

- mark and unmark accept view as var to avoid calling function multiple times
- fix missing door implementation for dic instead of list
- black format
@Wurschdhaud
Copy link
Contributor Author

fixed:

  • rename var room to element
  • mark and unmark accept view as var to avoid calling function multiple times
  • fix missing door implementation for dic instead of list
  • black format

additionally:
use class instead of enum for script entry and view validation. Intention as described in #2951 (comment) should be kept that way and be consistent.

@jmcouffin tested, rerun copilot to verify

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 6 comments.

@Wurschdhaud
Copy link
Contributor Author

I changed the warning to a progressbar to show the current number. I know that should be a separate PR, since it's no fix but a new feature, but it's a two liner, hope that's ok.
Easier to debug when the count that's happening in the background is actually visible.

@jmcouffin
Copy link
Contributor

I changed the warning to a progressbar to show the current number. I know that should be a separate PR, since it's no fix but a new feature, but it's a two liner, hope that's ok. Easier to debug when the count that's happening in the background is actually visible.

Great and no worry. If it is not messy, it not an oss nor pyrevit 🤣

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

Labels

Tools Issues related to pyRevit commands [subsystem]

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Parking spot renumbering changes element color only in the renumbered view (Revit 2023)

2 participants