LearnRevitAPI
πThis Prompt Will Help Beginners Understand Revit API Code Faster.
Jan 2, 2025
Did this happen to you?
Last month, I opened an old script of mine that I hadn't touched for a long time. I thought 'No problem - it's my own code, it won't take long '. But I was wrong...
You see, when I'm testing an idea, I write code quick and dirty. And then I go back and clean it up once I know it works.
But I hadn't refactored this one yet, and it felt like solving a rubik's cube in the dark.
Sound Familiar?
Now, imagine trying to read someone elseβs code written in the same rushed, chaotic style. What do you do?
Code can be Confusing
As you know, pyRevit and its extensions are open-source, which is amazing. It gives us access to hundreds, maybe even thousands of tools so we can:
Explore Code
Learn From it
Copy Reusable Snippets
But letβs be realβsometimes, looking at someone elseβs code is like reading another language.
Youβve probably heard the programmer joke:
When I wrote it, only God and I knew how it worked. Now, only God knows.
How to Reverse Engineer code?
Back in the day, reverse engineering meant hours of scrolling through code, documentation, googling every line of code you don't know and questioning your life choices. We all hated it, but we didn't have a better option.
Today, we do. AI has changed the game and we can get faster and better answers without judgement about asking stupid questions (I'm also guilty of the last one).
But here's the catch: AI is only as good as your prompt.
So you need to spend some time on creating better prompts to get much better results. Or you could use the prompt I made for beginners to help them reverse engineer sombody's code.
Would you want that?
The Prompt π
I was working on a tutorial for beginners and after some trial and error (and a lot of tea), I came up with this gem. It's perfect for helping beginners understand the code they found.
ββ-ββ-ββ-ββ-ββ-ββ-ββ-ββ-ββ-ββ-
Here is the prompt:
I want you to act as a seasoned Python software engineer with extensive expertise in Revit API and pyRevit. I will provide a piece of existing pyRevit code, and I need you to:
Provide a short and clear code overview outlining all the steps.
Write a step-by-step tutorial tailored for a beginner pyRevit user, explaining each section of the code in simple terms.
Describe all Revit API concepts used in the code, offering beginner-friendly examples where necessary.
Here is the code:
{PASTE CODE HERE}
ββ-ββ-ββ-ββ-ββ-ββ-ββ-ββ-ββ-ββ-
This prompt works magic because:
It explains the code in plain English without BS.
It generates a tutorial for beginners based on the code.
It identifies Revit API concepts you need to know and often explains them clearly for beginners.
The secret is to ask it to make a tutorial, it starts to think differently about the output. This approach is like having a teacher walk you through the code step by step.
But sometimes you need to ask that teacher twice π.
P.S.
Got a better prompt? Iβd love to hear what works for you when chatting with AI.
Just hit Reply!
Join Newsletter
π© You will be added to Revit API Newsletter
Join Us!
which is already read by 7500+ people!
The Bundle Price Increases in
Join Today with 30% OFF.