Hang tight while we fetch the video data and transcripts. This only takes a moment.
Connecting to YouTube player…
Fetching transcript data…
We’ll display the transcript, summary, and all view options as soon as everything loads.
Next steps
Loading transcript tools…
Revit API Setup Explained For pyRevit Beginners | Erik Frits | YouTubeToText
YouTube Transcript: Revit API Setup Explained For pyRevit Beginners
Skip watching entire videos - get the full transcript, search for keywords, and copy with one click.
Share:
Video Transcript
Video Summary
Summary
Core Theme
This lesson focuses on setting up a robust development environment for Revit API programming by installing essential add-ins and configuring two popular Integrated Development Environments (IDEs), PyCharm and Visual Studio Code, with Revit API autocompletion.
Mind Map
Click to expand
Click to explore the full interactive mind map • Zoom, pan, and navigate
hi everybody Welcome to the fourth
lesson of learn ravit API course we're
actually this close to actually dive
into ravit API code but before we do
that we need to set up your development
environment and it's not a complicated
process we will need to install a few
Revit addin that are necessary for any
ravit API developer and we need to set
up your IDE which stands for code editor
with a lot of useful features we'll
install two of the most popular code
editors which is pie charm and visual
studio code and we will set up right a
autocomplete in both of them and I
actually recommend you to have both of
them set up so in case one of them would
give you any errors or stop working you
can quickly jump to another and continue
your work with the code instead of
losing focus and spending time on
solving a bu all right and without
further Ado let's actually prepare your
development environment first of all
we're going to install a few addings the
first one is going to be ravit lookup
and we can get it on the GitHub just
type ravit lookup GitHub and then look
for repository from Jeremy tamic then in
here here you can scroll through and
read a little bit information for
example here's the difference between
single and multiple users and then when
you're ready come here and on the right
side look for releases I'm going to
click here here's the latest version at
the moment of the recording and I'm
going to scroll down to the assets
you'll notice that there are
installations for different versions in
my case I use 2023 so I'm going to
download this version right here
2023 then once it downloaded install it
like any other plugin you would do you
might see this message about Windows
protected on your PC then click here on
more info and run it anyway also if
you're interested this is made by the
Jeremy tamic who is part of Autodesk
development team so I'm pretty sure it's
very safe to use this then here's where
it's going to be installed click next
next and install and now it's complete
now the second plugin we need to install
is Revit python shell and it's kind of
optional and it's up to you first of all
let's find it and then I'm going to talk
more about it I'm going to look for
ravit python shell GitHub and I need
this architecture building system
environment right here let's click on
that this plugin was developed by Darren
Thomas and it's also the plugin on which
pyit was built on also you should know
that I don't think this plugin is
maintained anymore so there's a good
chance it's never will work on Ry 2025
and all the further versions so keep
that in mind but if you use 2023 2024 it
might be quite useful for debugging and
testing small Snippets so I'm going to
scroll down right here and have a look
here installers for all the older
versions and if you want to for 2023 and
probably 2024 but I'm not sure we can
get it right here all right and once
it's downloaded just install it as usual
and again remember this is an optional
plugin I will be using it once in a
while but in majority cases that's not
necessary all right we have the ravit
addins and that's all the next we going
to actually install our IDs and set up
your development environment for that
we're going to look for pie
charm and we're also going to look for
visual studio
code for visual Studio code we can
download it from this website let's
click here and then click on download
for Windows it takes you to thank you
page and it started downloading then
let's go here and Pie charm is made by
the jet brains so we're going to go to
their website and in here we're going to
download it and listen every time I make
tutorial about py charm they change
their landing page so it's very likely
it's going to change again very soon but
either way just go to the website and
look for the download button and make
sure you download the free community
version and not the professional one cuz
sometimes they make it very confusing
which one you download
and then in here this is py charm
professional and if I scroll down here
is py charm Community version edition
we're going to download that one all
right while we downloading the py charm
we're going to start installing the
visual studio code let's click on the
installer and in here we're going to
accept with the agreement then check
where you save it but I don't think it's
really relevant and just next next next
in here you might want to create desktop
icon then you want to click on those
ones so when you right click on the
python file or on the folder you can
open it inside of Visual Studio
code I'm not going to register it as my
main editor because I'm going to use py
charm as my main editor but if you
prefer Visual Studio code you can leave
it on and also going to add to path this
is Okay click on next and install all
right we finished installation of the
visual studio code let's click on finish
and it's going to open it and Meanwhile
we're also going to install the py charm
Community version let's click on next
next in here it's pretty much the same
options we want to add here open folder
project we want to add Community Edition
and in here I want to create
associations because I'm going to use py
charm as my main ID now click on next
and install
it all right by now we have installed
Visual Studio code in py charm it ask
you to restart your computer and you can
do that or you can do it later it's not
going to be an issue but before going to
configure them we need to download ravit
API stops so we can use them inside the
references to get the auto complete to
do that I'm going to go to learn rate
API blog and then there is one of the
Articles how to create R API stabs for
autocomplete in here there's going to be
a video in case you're interested how
you can create stabs yourself with pyit
but we don't want to do that right now
I'm just going to scroll down and
download it here or if you watch inside
of my course platform they're going to
be download links under the video now
I'm going to download 2023 and maybe
like 2021 just to show you two different
examples all right I downloaded them
here let's open both of
them and here here they are here is 2021
and here is
2023 first of all we want to find a
location where we're going to place them
I'm going to go to the upd
data and this is a really good place to
place them so you never delete them
accidentally in here I'm going to create
something like pie charm vs which stands
for virtual environment and I'm going to
explain what it means in a moment and in
here as you can see I already provided
here ravit API 2023 and ravit API
2024 normally you would just grab
whatever you downloaded and paste it
here here or anywhere else on your
computer doesn't matter where it's
located all right and now once you
downloaded your ravit API stabs we are
ready to configure your Visual Studio
code and Pie charm and it's not that
complicated we're going to start with
the visual studio code and let's open it
and have a look when you're going to
open it you're going to see this kind of
welcome page and in here you're going to
have your Explorer now in here you have
your Explorer you have your search bar
Source control this is for using the
GitHub then for running and debugging
and right here have a tab for the
extensions go to the extensions Tab and
have a look for the python then once
you're going to find the python right
here you can see it has 130 Millions
installations and click on the install
button right
here okay it tells me that it was
installed let's actually make it a
little bit bigger so we can see
more and now we're going to go to
explore then click on file and click new
file I'm going to call it script.py and
it doesn't matter where you place it for
now I'm just going to drop it on the
desktop later on you will be able to
open your fold the
structure then let's close the Explorer
we just want to test if the regular
python autocomplete already works you
can write something like import OS and
then let's write OS path join and you
can see every single thing that I write
I get some kind of suggestions get the
references to documentations and so on
so not that regular autocomplete for
python works this is already great now
the next thing we want to do is to
connected to ravit API autocomplete and
to do that you're going to go to
extensions find the python that you've
just installed and and right click and
there's going to be extension settings
right here then you will see here python
autocomplete extra paths this is where
you want to click edit in settings
Json I already have it set up and I'm
going to provide you all this code that
you can see on my screen in here you'll
see python. analysis. extra paths and
inside you need to provide a few paths
the first one already provided for Ravid
API stops and this is where you placed
it I placed first one right here and
actually let's change the path I'm going
to paste it
here and then make make sure that you go
inside of this path of whatever version
you're going to use in my case I want to use
use
2023 also make sure that you have double
slashes everywhere because sometimes
slash and a letter have special syntax
in the code so this way you're going to
set up your rabit API autocomplete
secondly you also want to connect your
pyit Masters folder library to do that
you need to find where your pyit is
installed usually if you're going to go
to up data like this then click on P or
scroll until you can find your Pit Master
Master
and inside there's going to be this pyit
library in here you can see py RIT RPV
and all of that copy this path and paste
it right here and also make sure you
have all your slashes two times so you
don't have this red highlight and this
library is Ed for whenever you're going
to write from py import forms forms
alert and so on it also going to give
you all the auto suggestions now save it
just to be sure that it works and now
let's go and try it again I'm going to
go to the script.py file
and then we're going to come here and
test it I'm going to write from Autodesk
ravy DB import everything and then we're
going to try to create some kind of
collector I'm going to try to use
filtered element collector class and it
doesn't give me any auto suggestions
which is a bit weird so I'm going to
close it and reopen it
again and now this time let's try again
and this time when I'm going to type
filtered element collector you can see
all the auto suggestions for example
here has to be a document and I can
write off class class of w type and so
on so on and so on now we know that
autocomplete works all right
autocomplete is complete now next is
really important let's go to the file
preferences and change one of the
settings let's go here to settings I'm
going to look for the
zoom and I love to have this mouse wheel
Zoom activated this way you can always
kind of hold control and kind of zoom in
zoom out to the code snippet depending
on whatever you're doing this is really
useful and also if you want to you can
search for different themes inside a
visual studio code editor so you can
choose how it looks maybe you prefer
some different colors and so on high
contrast and so on and you can choose
whatever color theme you prefer for your
code all right we've configured our
Visual Studio code and now let's
configure your py charm and to do that
you also need to install the python
version and the best way to find what
kind of python version do you need is to
actually open ravit go to py RIT and
right here you can click on the about
page once you do that you will see that
here is the version of py that you use
and it's going to tell you it's running
on the RN python 2.7.1
and it uses 3.8.5 for the cpython also
it's not that important which python
version you're going to install for your
py charm because in the end of the day
we going to write code and visual studio
code in pie charm but we never will
execute it inside of these code editors
because it will always tell you that
there are not enough references there
are issues because it cannot be
connected to the Revit we use the these
code editors to make it easier for us to
write with all the autocomplete with all
the features for selection refactoring
and so on and then we kind of take this
code put it in P Revit extension and
then we're going to go to Revit and
click on the button to actually run it
so keep this in mind you never run Revit
API code from Visual Studio code or py
Charm or any other ID you use it for
writing the code and then you're going
to run it with the py rabit engine or
with Dynamo engine or with Ravid python shell
shell
engine all right so let's go and install
python version
2711 and it's also not necessary to
install the Ron python version because
py charm and many other IDs they don't
always have the support for old versions
of RN python so therefore we can look
2.7.1 right here is the official python
website just scroll down and load here
one of the installers First Look the
operating system look for the windows
and I want to get my MCI installer this
fine all right once you're going to
download it we can just run and install
it I'm going to install it for all users
click on
next then in here is location where it's
going to be installed in my case it says
cpython 27 you can click on next in my
case I already have it installed so I'm
not going to override it I'm just going
to write here 2711 and click on next but
you just leave whatever is there if you
don't have it yet now in here you
probably don't want to touch anything
just click on next and you're going to
install it as usual now I'm going to
cancel it because as I said I already
have it installed and once you installed
it let's just go and open the pie charm
so we can also configure this
here is how it looks it also ask me if I
want to import settings from the visual
studio code and I don't want to do that
I want to have the default version of
the py charm because I want to have py
charm shortcuts and if you're going to
follow my tutorials with py charm you
probably also want to keep it this
way and this is the welcome screen of py
charm you can customize how it looks
already here some plugins and so on but
we're going to just create the project
and then configure from there you can
either create a new project or you can
open existing project and we can select
the extension that we already created in
the previous
lessons I'm just going to open the path
where my extension is located and it's
right here learn rate API
extension then let's enter here and make
sure that you select that extension and
not the outside folder it's not a big
difference but it's good to have this
one as the root folder then click on
okay it will often be asking do you
trust location when you open the project
and I totally trust my location because
I write all the
code and now here how it looks on the
left you have your EXP Explorer it also
going to give you some kind of help file
and what's new in pycharm 2024 actually
I haven't looked at it myself yet so I
don't know what's new in 2024 I used to
use 2022 or 23 I don't remember all
right in this new version of py charm a
few things have definitely changed and
it looks a bit different to what I'm
used to but normally here's the button
to open your project and right here in
the bottom you'll notice python 3.8 and
this is The Interpreter of the Python my
case it already has something we can
click here go to interpreter settings
now we want to either click here and
show all or add the new interpreter I'm
going to show all I'm going to add it
here add new interpreter and then in
here I'm going to use Virtual
environment virtual environments allow
us to prec configure python environments
for different purposes we could install
all necessary packages globally but that
would clut our development space and
might lead to bugs across different
python projects because of the
dependencies this virtual environment
allows you to create separate
configurations for different packages
and different package versions as you
want so they do not interact with each
other imagine that you have a container
that you would use for ravit API 2023
development you would put all necessary
packages references and ravit API stabs
for 2023 so this container is dedicated
for working with ravit API 2023 then you
could create similar containers for
Revit API 2024 2022 and so on or maybe
you would decide that you want to create
a website and you would need another
virtual environment with another set of
packages and references and then
whenever you create a new project you
can just grab the right container with
the Right Packages pre-installed and you
can easily switch between them during
development and this is what we're going
to do in py charm we're going to create
two virtual
environments so I'm going to click here
on the new and it often suggest you to
put the vent folder inside of your
project but in case of our parate
extension I would not recommend that
instead of that let's open a folder and
move it somewhere else I want to make
sure that it's actually inside of my app
data but in there I'm going to create a
new folder and I'm going to call it
something like parit virtual environment
then I'm going to go inside of there and
I'm going to create a new folder and
this is going to be for ravy 23 click on
okay and it has to be an empty folder so
click on okay then you need to select
your python version in my case I already
have Python 2.7 installed in C here but
you can select from one of the available
versions if you don't see your version
here you can click on free dots and find
the location yourself as I said mine is
located in the drive
C then there is Python 2.7 and you need
to click on the python. X and the moment
you click it's going to open the right
thing now we don't need this stick box
so click on okay and move further it's installing
installing
it now it's installing it and right here
we have our new virtual environment I'm
going to delete that one because I don't
want to use it I just need the
2023 let's also create the second one
for ravit
2021 in here I'm going to just write ravy
ravy
21 click on okay I use the same
interpreter click on okay now I have two
different Environ
and now in here we can click on show
interpreter paths and these are all the
different paths that python interpreter
is going to look for your packages or
stops or anything else we going to click
here on the path and we need to provide
the path to our Revit API
stops all right if I remember correctly
I think I put it here in pie charm Vin
and right here is the folder for Revit
21 and Rit 23 so I'm going to copy the
path come here and paste it on the
top and then inside I'm going to look
for the r 2023 I want to take this
folder and then we're going to add our
pyit masters folder which I can also see
right here we're going to go to pyit
library and we need this
path okay these are the two paths click
on Okay now click on RIT 2021 click on
The Interpreter and we're also going to
do the same we need our P RIT path and
we also need the path to our pie charm
environment in this case I think it's
going to be 2021 and let's click on okay
all right now click okay okay okay and
you can see on the bottom that it's
scanning all the folders indexing and
you have to wait until it's finished
before you're going to try
it okay it's complete and now here you
can see your interpreters I can see my R
21 and I can see R 23 and it's very
quick to jump between them now let's
quickly create a new python file I'm
going to call it test.py just to see if
we have our interpreter working and
first of all let's test the regular
python autocomplete going to import OS
and then right OS path join and you can
see it offers me all the auto
suggestions and so on the next we're
going to try from Autodesk RVE it and it
doesn't see it cuz I think we'll also
need to restart our pie charm so let's do
that and I see that it's still not
working so let's go and have a look
inside interpreter settings again I'm
going to show all and have a look at
these two then let's go and check the
paths and for some reason you can see
when you first add it sometimes it kind
of deletes it right away I don't know
why but we're going to try to add it
again going to take RAV 21 and we're
going to take our pit
Masters which is going to be this one
click on
okay and then 23 we're also going to do
the same let's add py RIT and then we're
also going to add ravit
2023 I don't know why it happens but
it's often when I install pie charm
create my interpreter and add paths
right away it doesn't remember the paths
on the first try and now if I'm going to
try from Autodesk cravy DB import
everything collector equals filtered
element collector and everything works
good and now we can also test different
ravit API versions right now I'm in my
ravit API 2023 I can write something
like category do and then there is a buil-in
buil-in
category this parameter is available in
2023 version so it gives me auto
suggestions but if I'm going to go to
2021 and remove it and then try to
category and then try to get built in
category it doesn't make me this
suggestions because this parameter
doesn't exist in R 21 and this way you
can jump between to make sure that you
get the right suggestions cuz sometimes
you can have the same method but in one
version it takes four arguments and in
the other it takes three arguments and
then you also have to make two different
scripts all right and if you followed me
along you should have your code editor
set up correctly and I strongly
recommend you to install both py charm
and visual studio code so you have a
back version and for your homework test
if your autocomplete work in both of
these code editors and if not try
restarting the code editor maybe check
if all the references are placed
correctly because you saw that my
references disappeared on the first try
in pie charm for some reason and lastly
rewatch this video again and make sure
that you follow all the steps correctly
but you can also let me know in the
community or the comment section below
if something went wrong or you need help
with anything but please describe all
the steps that you already tried and if
you get any error messages this will
help me identify the issue and help you
solve it and once everything works
correctly you're ready to start the next
lesson where we'll talk about pirate
script anatomy and we will create uh
templates that you will use for all your
scripts in the future so you never have
to start from blank page again I will
see you there and I want to wish you
Click on any text or timestamp to jump to that moment in the video
Share:
Most transcripts ready in under 5 seconds
One-Click Copy125+ LanguagesSearch ContentJump to Timestamps
Paste YouTube URL
Enter any YouTube video link to get the full transcript
Transcript Extraction Form
Most transcripts ready in under 5 seconds
Get Our Chrome Extension
Get transcripts instantly without leaving YouTube. Install our Chrome extension for one-click access to any video's transcript directly on the watch page.