Skip to content

Warn users when view range is driven by view template#3155

Merged
jmcouffin merged 8 commits intopyrevitlabs:developfrom
thumDer:3110-template-handling
Mar 2, 2026
Merged

Warn users when view range is driven by view template#3155
jmcouffin merged 8 commits intopyrevitlabs:developfrom
thumDer:3110-template-handling

Conversation

@thumDer
Copy link
Contributor

@thumDer thumDer commented Mar 1, 2026

Warn users when view range is driven by view template

Description

Check if view range of the selected view is driven by a template, and warn users on the UI and in an additional warning dialog about changes will be made to a view template, option to cancel.


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

image

Thank you for contributing to pyRevit! 🎉

devloai[bot]

This comment was marked as outdated.

@thumDer thumDer force-pushed the 3110-template-handling branch from 0801c4c to a48306d Compare March 1, 2026 17:49
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

Updates the View Range toggle tool to detect when a selected plan view’s view range is controlled by an assigned View Template, and to warn the user before proceeding—addressing issue #3110 where the tool could unintentionally override template-driven settings.

Changes:

  • Detects when PLAN_VIEW_RANGE is controlled by the view’s template and stores the controlling template reference.
  • Adds a confirmation dialog before applying view range changes when the view range is template-driven.
  • Updates the UI message to indicate when the view range is driven by a template (plus some formatting/line-wrapping refactors).

@jmcouffin jmcouffin marked this pull request as draft March 2, 2026 10:32
@jmcouffin jmcouffin added the Enhancement Enhancement request [class->Improved #{number}: {title}] label Mar 2, 2026
@thumDer thumDer marked this pull request as ready for review March 2, 2026 12:14
@jmcouffin jmcouffin merged commit e16430e into pyrevitlabs:develop Mar 2, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Mar 2, 2026

📦 New work-in-progress (wip) builds are available for 6.1.0.26061+1244-wip

@github-actions
Copy link
Contributor

github-actions bot commented Mar 2, 2026

📦 New work-in-progress (wip) builds are available for 6.1.0.26061+1357-wip

@github-actions
Copy link
Contributor

github-actions bot commented Mar 2, 2026

📦 New work-in-progress (wip) builds are available for 6.1.0.26061+1403-wip

@porrt23
Copy link

porrt23 commented Mar 4, 2026

@thumDer was the intention to update the view template view range as well or just provide the warning? I get the warning "about to change View Template" but the view template itself doesn't update. I also don't see anything in the code that is attempting to change the view template.

@thumDer
Copy link
Contributor Author

thumDer commented Mar 5, 2026

@porrt23 it was explained here: #3155 (comment)
In the version where I was testing it it changed the template as well, and if you read the original issue it also said that it changes the template even though it was not implemented.
In which version did you test it so it didn't change the template? I'll have a look at it once again, but it seems I might need to expicitly update the template after all.

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

Labels

Enhancement Enhancement request [class->Improved #{number}: {title}]

Projects

None yet

Development

Successfully merging this pull request may close these issues.

View Range Editor - Ignores View Templates

4 participants