/

/

09-auto-planner

/

/

09-auto-planner

Day

09

pyRevit

Challenge

Day

09

pyRevit

Challenge

|

|

|

|

|

|

|

|

|

|

|

|

|

|

|

21-Day pyRevit Challenge

Mon

Tue

Wed

Thr

Fri

Sat

Sun

Tool Of The Day:

"Auto-Planner"

Watch Bonus Training:
- Follow pyRevit FastTrack Setup
- Watch P.R.O.C.E.S.S. Masterclass

Creating views in Revit takes ages.

And on large projects, you might need to generate hundreds of them for apartments or some other special cases.

So let's create Auto-Planner that will generate new views and crop them to see correct elements.

Today We're Practicing:

>>>

Get and Sort Elements

>>>

✨Get Element By Id

>>>

✨Basic BoundingBox Workflow

>>>

✨Create and Crop FloorPlans

>>>

pyRevit Print Table

Let's Create

"Auto Planner"

Using 7-Step PROCESS

Let's Create

"Auto Planner"

Using 7-Step PROCESS

.

.

.

.

.

.

.

PLAN

Imagine Creating 1,500 plans in 1 click…

The Goal for Today:

Create FloorPlan Generator for apartment rooms based on their BoundingBox information. Plus, it would be awesome to have an interactive report to open new view, select room and even display some apartment data…

Let's build it.

.

.

.

.

.

.

.

RESEARCH

Coding CheatSheet

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

Coding Blocks

Get Element by Id

Read BoundingBox Property

Create new BoundingBox With Offset

Create Linkify Object

pyRevit output - print_table

Create New FloorPlan

Set and Activate View CropBox

Convert Units To Internal

BoundingBox From Multiple Elements

Rename Unique

Get Element by Id

Create New FloorPlan

Read BoundingBox Property

Set and Activate View CropBox

Create new BoundingBox With Offset

Convert Units To Internal

Create Linkify Object

BoundingBox From Multiple Elements

pyRevit output - print_table

Rename Unique

Revit API Docs
  1. Application.VersionNumber Property

  2. 2026 - ElementId Constructors

  3. 2025 - ElementId Constructors

  4. UnitUtils.ConvertToInternalUnits Method

  5. UnitTypeId Class

  6. Document.GetDefaultElementTypeId Method

  7. Element.BoundingBox Property

  8. BoundingBoxXYZ Class

pyRevit Dev Docs
Notes

🔸BoundingBox Orientation

Keep in mind that BoundingBoxes will not rotate with elements… They will be oriented according to the view.

🔸Add BoundingBox Offet

To modify the BoundingBox size, you need to provide new .Min or .Max points that determine the whole size of the box.
(Min - Bottom Left / Max Top Right cornets.)

🔸Revit API Units!

Remember that Revit API uses feet internally. This is important if you want to set specific offset to your BoundingBoxes.

🔸ElementI 2026 Update…

Starting from Revit API 2026+ they've updated the basics ElementId constructor. For some reason they went from Int32 -> Int64.

The issue… Th regular numbers are Int32 in IronPython, and to make it Int64 we need to import and use Int64 class… I'll explain more in Code.

.

.

.

.

.

.

.

RESEARCH

Coding CheatSheet

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

Coding Blocks

Get Element by Id

Create New FloorPlan

Read BoundingBox Property

Set and Activate View CropBox

Create new BoundingBox With Offset

Convert Units To Internal

Create Linkify Object

BoundingBox From Multiple Elements

pyRevit output - print_table

Rename Unique

Revit API Docs
  1. Application.VersionNumber Property

  2. 2026 - ElementId Constructors

  3. 2025 - ElementId Constructors

  4. UnitUtils.ConvertToInternalUnits Method

  5. UnitTypeId Class

  6. Document.GetDefaultElementTypeId Method

  7. Element.BoundingBox Property

  8. BoundingBoxXYZ Class

pyRevit Dev Docs
Notes

🔸BoundingBox Orientation

Keep in mind that BoundingBoxes will not rotate with elements… They will be oriented according to the view.

🔸Add BoundingBox Offet

To modify the BoundingBox size, you need to provide new .Min or .Max points that determine the whole size of the box.
(Min - Bottom Left / Max Top Right cornets.)

🔸Revit API Units!

Remember that Revit API uses feet internally. This is important if you want to set specific offset to your BoundingBoxes.

🔸ElementI 2026 Update…

Starting from Revit API 2026+ they've updated the basics ElementId constructor. For some reason they went from Int32 -> Int64.

The issue… Th regular numbers are Int32 in IronPython, and to make it Int64 we need to import and use Int64 class… I'll explain more in Code.

.

.

.

.

.

.

.

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
All Rooms

card-background

5

Set
View Crop

card-background

2

Sort Rooms
By Apartments

card-background

6

Display
Interactive Report

card-background

3

New FloorPlan
For Each Flat

card-background

4

Calculate New
View CropBox

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
All Rooms

card-background

5

Set
View Crop

card-background

2

Sort Rooms
By Apartments

card-background

6

Display
Interactive Report

card-background

3

New FloorPlan
For Each Flat

card-background

4

Calculate New
View CropBox

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

SCRIPT: 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

SCRIPT: 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

REFACTORED CODE

REFACTORED CODE (With Functions)

.

.

.

.

.

.

.

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

REFACTORED CODE

REFACTORED CODE (With Functions)

.

.

.

.

.

.

.

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

#1 - API Changes (ElementId)

#2 - Ensure Apartment Dictionary

#3 - Ensure Room is Placed

AI Prompt - Stress Test

.

.

.

.

.

.

.

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