Skip to content

Extend “Rename Selected Sheets” to support true batch renaming modes#3389

Draft
Copilot wants to merge 6 commits into
developfrom
copilot/check-if-issue-880-is-still-valid
Draft

Extend “Rename Selected Sheets” to support true batch renaming modes#3389
Copilot wants to merge 6 commits into
developfrom
copilot/check-if-issue-880-is-still-valid

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 21, 2026

  • Fix "can not" → "cannot" in all three user-facing alert messages (lines 33, 53, 66)

@devloai
Copy link
Copy Markdown
Contributor

devloai Bot commented May 21, 2026

Unable to trigger custom agent "Code Reviewer". You have run out of credits 😔
Please upgrade your plan or buy additional credits from the subscription page.

@jmcouffin jmcouffin requested a review from Copilot May 21, 2026 19:41
@jmcouffin jmcouffin added the Tools Issues related to pyRevit commands [subsystem] label May 21, 2026
Copy link
Copy Markdown
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 extends the pyRevitTools → Drawing Set → Sheets → “Rename Selected Sheets” command from simple case conversion into a true batch-renaming tool with multiple rename modes, preview/confirmation, and conflict/result reporting.

Changes:

  • Added mode-driven batch rename operations: find/replace, prefix, suffix, uppercase, lowercase.
  • Added precomputation of target names with preview + confirmation and categorized reporting (renamed/unchanged/conflicts/failed).
  • Updated the en_us tooltip text to reflect the expanded capabilities.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.

File Description
extensions/pyRevitTools.extension/pyRevit.tab/Drawing Set.panel/Sheets.pulldown/Rename Selected Sheets.pushbutton/script.py Replaces the prior case-only renamer with mode-based batch renaming, preview, conflict checks, and 2-phase rename execution.
extensions/pyRevitTools.extension/pyRevit.tab/Drawing Set.panel/Sheets.pulldown/Rename Selected Sheets.pushbutton/bundle.yaml Updates the English tooltip to describe the new batch rename features.

Comment on lines +254 to +262
unique_pairs = []
for pair in valid_pairs:
name_taken = False
for sheet_id, sheet_name in all_sheet_names.items():
if sheet_id in selected_sheet_ids:
continue
if sheet_name == pair['new_name']:
name_taken = True
break
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 7f286e7 — replaced the nested loop with a precomputed existing_names set built from all_sheet_names (excluding selected sheets), so the conflict check is now O(1) per candidate.

Comment on lines +32 to +34
if find_txt == '':
forms.alert('Find text can not be empty.')
return None
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 2c45e3a — changed all three instances of "can not" to "cannot" (lines 33, 53, 66).

jmcouffin and others added 2 commits May 21, 2026 21:46
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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.

3 participants