<Code Lib>
👍 0 👁 6

EF-pyRevit Template

by @erik_frits · Jul 8, 2026

Description

This is my pyRevit Template that I've developed over the years of creating 250+ pyRevit Tools. Use it to get clear structure every time you start new .pushbutton

Code

pyRevit
# -*- coding: utf-8 -*-
__title__   = "pyRevit Template"
__doc__     = """Version = 2.0
Date    = 07.07.2026
________________________________________________________________
Description:
Placeholder for pyRevit .pushbutton.
Use it as a base for your new pyRevit tool.

________________________________________________________________
How-To:
1. Step 1...
2. Step 2...
3. Step 3...

________________________________________________________________
To-Do:
[FEATURE] - Describe Your Feature...
[BUG]     - Describe Your BUG...

________________________________________________________________
Last Updates:
- [01.01.2026] v1.0 Change Description
- [01.01.2026] v0.5 Change Description
- [01.01.2026] v0.1 Change Description 
________________________________________________________________
Author: Erik Frits (from LearnRevitAPI.com)"""

# ╦╔╦╗╔═╗╔═╗╦═╗╔╦╗╔═╗
# ║║║║╠═╝║ ║╠╦╝ ║ ╚═╗
# ╩╩ ╩╩  ╚═╝╩╚═ ╩ ╚═╝
#░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
from Autodesk.Revit.DB import *

#pyRevit
from pyrevit import forms, script

#.NET Imports
import clr
clr.AddReference('System')
from System.Collections.Generic import List         # (Often Required For RevitAPI)


# ╦  ╦╔═╗╦═╗╦╔═╗╔╗ ╦  ╔═╗╔═╗
# ╚╗╔╝╠═╣╠╦╝║╠═╣╠╩╗║  ║╣ ╚═╗
#  ╚╝ ╩ ╩╩╚═╩╩ ╩╚═╝╩═╝╚═╝╚═╝
#░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
doc    = __revit__.ActiveUIDocument.Document #type:Document
uidoc  = __revit__.ActiveUIDocument
app    = __revit__.Application               # __revit__ is internal pyRevit variable
output = script.get_output()                 # pyRevit Output Menu

# ╔╦╗╔═╗╦╔╗╔
# ║║║╠═╣║║║║
# ╩ ╩╩ ╩╩╝╚╝
#░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░



#🤖 Automate Your Boring Work Here
print('⌨️ALT+CLICK to open Source-Code Location.')



#███████████████████████████████████████████████████████████████████████████
# 🚨 𝗧𝗵𝗶𝘀 𝗰𝗼𝗱𝗲 𝗼𝗻𝗹𝘆 𝘀𝗼𝗹𝘃𝗲𝘀 𝗼𝗻𝗲 𝗽𝗿𝗼𝗯𝗹𝗲𝗺...
# 𝘆𝗼𝘂 𝗰𝗮𝗻 𝗹𝗲𝗮𝗿𝗻 𝗵𝗼𝘄 𝘁𝗼 𝘀𝗼𝗹𝘃𝗲 𝗺𝗮𝗻𝘆 𝗼𝗳 𝘆𝗼𝘂𝗿𝘀!

# To Learn More: visit www.LearnRevitAPI.com
guest@rvtdocs: ~/discuss

Want to join the conversation?

rvtdocs auth

Share & save code Comment on pages Save bookmarks Upvote snippets Gamification

Loading…