Skip to content

Enhancement ex import#3022

Merged
jmcouffin merged 9 commits intopyrevitlabs:developfrom
Wurschdhaud:enhancement-ex-import
Feb 1, 2026
Merged

Enhancement ex import#3022
jmcouffin merged 9 commits intopyrevitlabs:developfrom
Wurschdhaud:enhancement-ex-import

Conversation

@Wurschdhaud
Copy link
Copy Markdown
Contributor

@Wurschdhaud Wurschdhaud commented Jan 17, 2026

Description

  • keeps field format overrides for schedule exports
  • keeps order for schedule exports
  • added support for ElementId and workset import via name comparison

Checklist

  • Code follows the PEP 8 style guide.
  • Code has been formatted with Black using the command:
  • Changes are tested and verified to work as expected.

Related Issues

@devloai
Copy link
Copy Markdown
Contributor

devloai bot commented Jan 17, 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 previously approved these changes Jan 17, 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 enhances the Excel import/export functionality for Revit schedules by adding several improvements to data handling and field formatting.

Changes:

  • Preserves field format overrides when exporting schedules to Excel, ensuring units and formatting match the schedule's display settings
  • Maintains column order from schedules during export by respecting the schedule's field order
  • Adds support for importing ElementId parameters via name comparison to match elements by name rather than ID
  • Adds support for importing Workset parameters via name comparison to assign worksets by name

Reviewed changes

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

File Description
XLS Export.pushbutton/script.py Enhanced to preserve schedule field format overrides and maintain field order during export; added metadata sheet to store format information
XLS Import.pushbutton/script.py Added ElementId and Workset import support via name-based matching; enhanced to use exported metadata for proper unit conversions

@jmcouffin
Copy link
Copy Markdown
Contributor

jmcouffin commented Jan 17, 2026

Reviewed the code quickly, it looks fine.
I haven't tested it, would you happen to have a test file, if so, that would expedite the review. @Wurschdhaud

@jmcouffin
Copy link
Copy Markdown
Contributor

How to Test

Setup

  1. Check out the PR branch:

    git fetch origin pull/3022/head:enhancement-ex-import
    git checkout enhancement-ex-import

    Or download from: https://github.com/Wurschdhaud/pyRevit/tree/enhancement-ex-import

  2. Reload pyRevit after checking out the branch

Test 1: Schedule Field Format Overrides

  1. Open a Revit project
  2. Create or open a schedule with custom field formatting (e.g., override units for specific columns)
  3. Run pyRevit tab → Modify → Edit → XLS Export
  4. Select the schedule and export
  5. Verify:
    • Check the exported Excel file has a hidden _metadata sheet
    • Columns should show the schedule-specific unit overrides (not just project units)
    • Re-import the file and verify units are correctly converted back

Test 2: Schedule Field Order

  1. Create a schedule with columns in a specific order
  2. Export using XLS Export
  3. Verify: Column order in Excel matches the schedule field order

Test 3: Workset Import

  1. In a workshared project, export elements with the "Workset" parameter
  2. Edit workset names in the Excel file
  3. Run pyRevit tab → Modify → Edit → XLS Import
  4. Verify: Workset assignments update based on workset names

Test 4: ElementId Import

  1. Export elements with ElementId parameters (e.g., material, type references)
  2. In Excel, change the ElementId parameter values to different element names
  3. Import the file
  4. Verify: ElementId parameters are updated by matching element names

Test 5: General Export/Import

Test other export scopes to ensure nothing broke:

  • Document (all elements)
  • Document - types only
  • Document - instances only
  • Current View
  • Selection

@jmcouffin
Copy link
Copy Markdown
Contributor

@Wurschdhaud since testing it doesn't seem to interest the community, would you mind testing it with the above?
I want it to make it in the release.
Pressing the button in a bit.

@Wurschdhaud
Copy link
Copy Markdown
Contributor Author

I did so constantly during developing it, I think I'm blind for errors now, if there are any

@jmcouffin
Copy link
Copy Markdown
Contributor

I'll trust you on that.

@jmcouffin jmcouffin merged commit ae103fc into pyrevitlabs:develop Feb 1, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 1, 2026

📦 New work-in-progress (wip) builds are available for 5.3.1.26032+1937-wip

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 1, 2026

📦 New work-in-progress (wip) builds are available for 6.0.0.26032+1956-wip

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 1, 2026

📦 New work-in-progress (wip) builds are available for 6.0.0.26032+2005-wip

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 1, 2026

📦 New work-in-progress (wip) builds are available for 6.0.0.26032+2008-wip

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 1, 2026

📦 New public release are available for 6.0.0.26032+2040

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Feb 1, 2026

📦 New public release are available for 6.0.0.26032+2040

@Wurschdhaud Wurschdhaud deleted the enhancement-ex-import branch February 4, 2026 15:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Excel Export Import - Unit check per Parameter - (review schedule column settings)

3 participants