/

/

21-excel-smuggler

/

/

21-excel-smuggler

Day

21

pyRevit

Challenge

Day

21

pyRevit

Challenge

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

21-Day pyRevit Challenge

Mon

Tue

Wed

Thr

Fri

Sat

Sun

🔓CLICK HERE TO UNLOCK BONUS DAYS

Tool Of The Day:

"Excel Smuggler"

Somehow Revit still doesn't support Excel…

There are workaround, but we might as well just create our own Excel Import/Export tool with full control. Let's look into that…

Today We're Practicing:

>>>

Excel Export✨

>>>

Excel Import✨

Let's Create

"Excel Smuggler"

Using 7-Step PROCESS

Let's Create

"Excel Smuggler"

Using 7-Step PROCESS

.

.

.

.

.

.

.

PLAN

Revit -> Excel

Revit has a lot of data, but it's not great to work with in within Revit… Instead it would be far better if we could take it outside to Excel and work on our report there. Plus if we could link it back to update data in bulk would be a bonus.

So, the Goal for Today:

Createa a tool that can read a bunch of Revit elements and prepare data for the export. Then export it as an Excel file and have a separate tool to actually import the same data back but update Revit values according to Excel changes.

.

.

.

.

.

.

.

RESEARCH

Coding CheatSheet

Here's everything you might need for today's challenge.

Coding Blocks

Select Sheets with pyRevit

Get pushbutton path

Excel Export

Read Excel

Filename with timestamp

Prepare Export Data

Preview data in Revit

Get Sheets From Excel

Select Sheets with pyRevit

Filename with timestamp

Get pushbutton path

Prepare Export Data

Excel Export

Preview data in Revit

Read Excel

Get Sheets From Excel

Notes
Revit API Docs
pyRevit Dev Docs
EF-Notes:

🔸 How To Read/Write Excel ?

To work with Excel in python we have mutliple options:

  • Packages (xlsxwriter, xlrd, openpyxl..)

  • Using .NET

  • Writing raw .xml file that becomes Excel (AI only)

xlsxwriter and xlrd are incldued with pyRevit by default!
openpyxl - python 3 only…

.

.

.

.

.

.

.

RESEARCH

Coding CheatSheet

Here's everything you might need for today's challenge.

Coding Blocks

Select Sheets with pyRevit

Filename with timestamp

Get pushbutton path

Prepare Export Data

Excel Export

Preview data in Revit

Read Excel

Get Sheets From Excel

Notes
Revit API Docs
pyRevit Dev Docs
EF-Notes:

🔸 How To Read/Write Excel ?

To work with Excel in python we have mutliple options:

  • Packages (xlsxwriter, xlrd, openpyxl..)

  • Using .NET

  • Writing raw .xml file that becomes Excel (AI only)

xlsxwriter and xlrd are incldued with pyRevit by default!
openpyxl - python 3 only…

.

.

.

.

.

.

.

OUTLINE

Step-by-Step Plan

Break down logic of the tool idea into smaller chunks so it's easier to brainstorm, find hidden steps and code.

1

Get
Elements

card-background

5

Export Data
To Excel

card-background

2

Read Elements
Data

card-background

6

Report Data
in Revit

card-background

3

Prepare Data
For Export

card-background

*

Read/Import
Data Back?

card-background

4

Generate
Excel Filepath

card-background

.

.

.

.

.

.

.

OUTLINE

Step-by-Step Plan

Break down logic of the tool idea into smaller chunks so it's easier to brainstorm, find hidden steps and code.

1

Get
Elements

card-background

5

Export Data
To Excel

card-background

2

Read Elements
Data

card-background

6

Report Data
in Revit

card-background

3

Prepare Data
For Export

card-background

*

Read/Import
Data Back?

card-background

4

Generate
Excel Filepath

card-background

NB!

TRY BUILDING
THIS TOOL YOURSELF
DON'T RUSH TO SOLUTION

Unless… You're a Beginner


According to GENERATION EFFECT

The Harder You Work, The Deeper It'll be Wired in Your Brain

NB!

TRY BUILDING
THIS TOOL YOURSELF
DON'T RUSH TO SOLUTION

Unless… You're a Beginner


According to GENERATION EFFECT

The Harder You Work, The Deeper
It'll be Wired in Your Brain

.

.

.

.

.

.

.

CODE

Code Quick-n-Dirty.

The Goal is to create a proof of concept. Don't try to make it perfect. Skip steps if necessary. Keep it ugly. Keep it slow. JUST. MAKE. IT. WORK…

Proof Of Concept

PROOF OF CONCEPT

.

.

.

.

.

.

.

CODE

Code Quick-n-Dirty

The Goal is to create a proof of concept. Don't try to make it perfect. Skip steps if necessary. Keep it ugly. Keep it slow. JUST. MAKE. IT. WORK…

Proof Of Concept

PROOF OF CONCEPT

.

.

.

.

.

.

.

EDIT

Refactor Everything

Once proof-of-concept works - we can focus on all steps to make everything more structured, optimized and easier to read.

REFACTOR CODE

Excel Smuggler (Import)

Excel Smuggler (Export)

.

.

.

.

.

.

.

EDIT

Refactor Everything

Once proof-of-concept works - we can focus on all steps to make everything more structured, optimized and easier to read.

REFACTOR CODE

Excel Smuggler (Import)

Excel Smuggler (Export)

.

.

.

.

.

.

.

STRESS-TEST

Time To Break It!

Don't rush sharing your tools.

Try breaking it before your team does it… You don't want to hear how your tools fails at the cost of your reputation.

https://www.loom.com/share/d9a77a1949f54c95a90ec1778062c575

AI Prompt - Stress Test

Excel Smuggler (Export)

Excel Smuggler (Import)

.

.

.

.

.

.

.

SHIP

Submit Your Code.

Congratulations! Another tool is complete.

Now let's reflect on what we've learnt and submit your code to keep track of your progress.

.

.

.

.

.

.

.

SHIP

Submit Your Code.

Congratulations! Another tool is complete.

Now let's reflect on what we've learnt and submit your code to keep track of your progress.

Time To Celebrate

Share Your Win On LinkedIn
With #pyRevitChallenge

I'll Embed You Here!


Below it's just a placeholder for now…

© 2023-2026 EF Learn Revit API

© 2023-2026 EF Learn Revit API

© 2023-2026 EF Learn Revit API