This lesson provides a comprehensive overview of the resources and structure included in a "pyRevit starter kit" for Revit API development, emphasizing how to leverage these tools for efficient coding and customization.
Mind Map
Click to expand
Click to explore the full interactive mind map • Zoom, pan, and navigate
hi everybody Welcome to the third lesson
of learn rid API course in the previous
lesson we've created our own custom par
extension and now I want to go over it
and explain you the basics and all the
free resources that you got with my
starter kit there's really a lot of them
and they will be very beneficial to any
ravit API developer and now let's just
dive straight into this and have a look
right here I have my learn R API
extension open which I've just created
and you can see a bunch of different
buttons first of all you get your about
page where I'm going to congratulate you
on creating your own P RIT extension and
this is where you can leave a
testimonial for the starter G then in
here you will find the resources and
then you have different placeholders and
Dev panel we're going to get to this in
a moment first I want to focus on
resources because I believe this is
where the True Value comes from first of
all I provided here a lot of links to
all the common documentation that you
need you'll be able to find here par RIT
developer documentation ravit API
documentation ravit developers guide
from Autodesk and this is actually a
very interesting guide it's going to be
for the C users but still you can take
any c code and translate it to python
which chbt but in here I found that it's
actually very good for the advanced
topics and for example if I'm going to
have a look here and maybe let's say
that I click here on Dynamic model
updator there is a updator and you find
a lot of different information code
samples and so on it just depends on
what kind of topic you want to learn
from then in here you find links to my
ebooks there's going to be beginner's
guide to ravit API and filtered element
collector guide how to master getting
your elements where you're going to find
a lot of cold Snippets and
explanations then you're going to find
here templates this is a template form
Dynamo primer and it's for python notes
in Dynamo and then here is the py
template and py minimum template this
one is exaggerated version because
there's going to be literally everything
there's going to be a lot of comments
and so on and this is more like for
Education purpose but in reality you
would mostly use this pyate minimum
version where you get a few regular
Imports a few variables and then you you
just can start coding this is what I
would normally copy and paste into new
buttons and start creating tools but
we're going to cover it in one of the
next lessons where I'm going to explain
you par
Anatomy now we're going to go to more
interesting things now we're going to
look at the resources in here you will
find different links to the forums SDK
stabs also link to my website to the
free lessons which you already watch
it's going to be this first module of
the course and then in here you're going
to find Autodesk University rid API this
is just going to take you to Autodesk
University with a filter for Ravid API
sessions and you can scroll through and
see and maybe you're going to find
something that really interesting to you
but also keep in mind that many of this
presentation is going to be quite
outdated all right now we're moving to
more interesting resources and I'm going
to start with the code samples first of
all you can go to the GitHub and search
for pyit there is a link right here and
when you search for pyit you're going to
find 243 results of other pyit extension
and it means that you can just scroll in
here maybe click on other extension and
have a look inside and you're going to
find like hundreds if not thousands of
different code examples for example this
is extension of my tutorials for YouTube
and you can find here different examples
example here's element parameter filter
how does it work I click here and here's
the code and another thing if you're
going to replace this github.com to
GitHub Dev you're going to open the same
repository but in the online version of
Visual Studio code and it's going to be
much easier for you to navigate and find
whatever you want from this
extension now let's close that let's
have a look more then also in here you
find learn rate API python Snippets this
is going to be on my website where I
just drop a bunch of different Snippets
I don't have any search implemented yet
but if you scroll through you're going
to find lots of different examples
here's how you create a beam there's
going to be a code snippet here is how
to create a room then how to find key
parameter items how to get crop box and
so on so on so on you can see there's
really a lot of them and now we're going
to have a look at the most valuable part
of the starter kit and this is the code
samples I didn't just create you a
extension with the folder structure also
included here a lot of code samples
let's say that you want to know more
about RAV API selection I'm just going
to left click on this button and it's
going to open this file in the py charm
it's also going to open the folder with
all my samples and templates right here
which you can explore but in here you
find a lot of value for example for the
selection here's an example how to get
selected elements how to select elements
with rectangle how to pick an object how
to pick multiple objects pick Point pick
box set selection in RIT UI and so on so
on so on let's say that you want to
learn something about parameters I'm
going to click here on code samples
parameters here's how to select an
object to work with then how to get
instance parameters type parameters how
to read the values how to get built-in
parameters shared parameters and all all
of that and many many more this is where
the True Value comes I strongly
recommend you to just explore here and
have a look inside here is how to select
different elements how to create a wall
create line create room text beam field
region how to copy elements and so on so
on so on I try to include as much as I
could but also keep it very beginner
friendly and then for more intermediate
users you will also notice that there's
vpf form sample and custom UI in ravit
is a big topic but I'm going to make
like a mini course maybe even the whole
course soon and here's an example in
here we can write maybe some text
examples text one text two then click on
checkboxes select something here I also
have it right here we can click on it
submit and then going to get all of this
inputs printed out and if you want to
know how it works you would just come
here hold alt on your keyboard and click
on any of these buttons and you're going
to open the folder where this button is
located and when you deal with vpf you
will learn that you need the examl file
for the front end and then script that
Pi file for the back end and this is
going to be a really good example for
people starting out with a custom UI but
this is not a beginner friendly topic I
have to warn you about that all right
and this is pretty much all about Cod
examples you'll find here a lot this one
is also nice translate C in here I try
to include here's how you do this in C
here's how you do this in Python but if
you inside my P course there's going to
be a whole lesson where I'm going to
break it down all the differences
between C and python I think it's going
to be in the second module lastly this P
RIT starterkit also includes EF ravit
API tutorials you can click here it's
going to also open my custom UI and
there's going to be linked to my YouTube
videos and there's quite a lot you can
find interesting you can find how to
read RPI documentation RPI resources my
road map hooks how to automate sections
and so on so on so on let's just close
it and that's it about the code samples
and Rit API
tutorials and again right here is the
button to leave a review for the starter
kit and I hope you're going to like it
and you're going to share your
experience on the bottom you also get
links to my blog my newsletter if you
want to read something else there's
really a lot of information that I cover
about ravit API and here if you scroll
through you will see for example how to
purge view templates how to create view
field filers and just various topics
that I share in my newsletter we can
scroll through and you can see there's
lots of text lots of images cuz I try to
send this kind of mini tutorials to your
inbox but this specific case it's
actually not that many but it was very
useful to many
people now let's have a look at the
placeholder panel and Dev
panel this is just kind of to show you
the structure of pabit because if you're
going to look at this image right here
py RIT is just all about creating the
right folder structure and pyit knows
how to display it so every button in our
extension in py RIT extension or others
like EF tools extension it's just based
on the folder structure and you can hold
alt and click on any buttons let's say
that I want to come here to view filters
and have a look how do I create a
legend when you're going to click it's
going to open a folder but sometimes it
opens the folders in the background but
I can see it right here I can open it
scroll through and see how other people
create their code in this case this is
not a simple example because there's a
lot involved there's custom UI and so on
but you're also going to find a lot of
simple examples for example let's have a
look here how do we unhide all elements
in the active view we're going to open
this up and you'll see this is a very
simple tool just going to Grapple
elements and then create a list and then
unhide it very simple for any beginner
but what it means for your extension is
that it's very easy to modify let's just
hold out and click on one of these
buttons and you'll see that we're going
to open the folder then when I'm going
to go outside to the dev panel for
example you'll notice I have my Dev
button one two three and same is here I
have my Dev panel and then there is
button one two and three when I'm going
to go out to the tab it refers to learn
R API Tab and in here I have all the
panels my about panel which you can see
right here then the resources panel
which I can see right here then
placeholder panel which is this one and
so on so it's very easy to understand
how everything is working by looking at
the folder structure which you have here
and then see what do you actually get
inside of ravit for example I can see
right here is my push button my URL
button which is this one and this one
then they have this kind of Stack menu
where we can place three different items
and it's going to be this stack example
and after that we have our pull down
example we can also put the pull down
menus inside of the stacks so we can put
even more tools it's very simple and
occasionally you also going to see the
bundle. yaml file inside of this file
you will see that we can control the
layout of our extension if you want to
change the order of things because for
example you can see that in here I have
a bunch of different folders and this is
how they look but in here I want to make
sure that the push button is the first
one then we have URL button then we have
the stack panel and then we have pull
down menu and it follows along all of
this and now if you would want to create
new buttons you would just come here
copy one of the push buttons for example
and we would rename it I would call here new
new
button what's important is that you
leave this that push button in the end
this is what really matters here let's
open it up I'm going to open the script
make sure you also rename it here I'm
going to call it new button inside there
is my regular template and you'll notice
that you have to automate your boring
work here and you need to delete this
part right here because by default all
these buttons are made that when you
click on them it's just going to open
this menu and say button one was clicked
and you can hold out and click to open
the source code of this button I'm going
to click on this push button it's going
to say push button was clicked the same
description and listen I'm going to talk
about this in just a moment but first I
just created a copy of my push button
and I don't see this this because I have
to go to to py Revit and click right
here to reload this way py Revit will
look again at our folder structure and
sees if there are any changes and if
there are changes then it's going to add
buttons or remove them depending on what
you do so when we're going to go back
you see that I still have nothing and
this is correct because again if I'm
going to go to this folder structure go
to the panel I have my bundle that yaml
file right here I need controls what is
shown and what is not shown so in case
you use ordering you would need to copy
the name of your button open the bundle
and say okay I want to see it in the end
we don't need that push button here just
the first part of the name and then save
it and then it's going to be shown or we
can delete this bundle yaml completely
and then it's going to show all the
buttons inside of it but they going to
have the same order as they have inside
of this folder structure so this is
going to be the first second third and
so on I'll bring back because I think I
want to have my own order I'm going to
reload P RIT again so we can see this
new button so whenever you're going to
create new buttons in pyit and you don't
see them usually there are a few reasons
first you might have misspelled one of
these endings because that extension
that tab that panel that push button
they have to be all lowercase exactly
like this and I had people reach out to
me saying that they did something wrong
it doesn't show then we notice that that
that push button had free T instead of
two for some reason it just happens just
be aware of that or as I just showed you
it's because of this bundle. yaml file
which controls the order and if you
haven't included your button then you
know going to see this and now have a
look right here there is my new button
so I just duplicated one of the folders
and I have this new button right here
also as I've mentioned when you click on
any of these buttons you're going to
have the same message over and over and
it's all about reusing the code I'm
going to explain it in more details in
one of the next lessons but for now I
just want to point your attention that
when you're going to go to learn rate
api. extension or however you called
your extension you're also going to
notice there's a library folder and
there is hooks hooks are very special
things it's like event triggers in py
rit in there you can subscribe to
certain events and then you can trigger
some code for example in here I left the
code but if I'm going to comment out all
of that and then reload py RIT then this
hook will start working and I'm maybe
going to explain hooks by the end of
this course because this is a very
Advanced topic and I think beginners
should avoid it at all cost but I going
to show you that when I'm going to do
that then I'm going to go to insert Tab
and click on import cat
and this is the event that I subscribe
to and whenever I do this I'm going to
get this message import CAD is not
allowed use CAD link instead you can do
whatever you want in there and also I
provided here something for the password
on the users with password can import
cat honestly I don't remember the
password it's somewhere here uh it's
learn ri.com
so if I would put it here click on okay
then I would be able to import cats
again this is not a topic for the
beginners hooks are really for the
intermediate and advanced users because
you have to make your code very
efficient because it will be executed
every time event happens in this case
it's not a problem but if you're going
to make an event for for example
checking one of the parameters it's
going to be executed every time and it
has to be very efficient that's it about
Hooks and then library in library
there's going to be a whole tutorial in
this first module where I'm going to
show you how you can reuse your
code so instead of copy pasting the same
function I just wrote it once right here
which is called kid button clicked and
then in inside all of my new buttons and
stuff here on the bottom from Snippets
custom print I import this kit button
clicked and then I execute it this way I
have one place where this function is
located I can update it here and it's
going to be applied to all the places
where it's used because you know good
programmers code but great programmers
they reuse code and this is why you
should start reusing your code as soon
as possible but we're going to have a
whole lesson about it in a moment don't
stress it right now all right I hope
that you get a really good understanding
about pyit folder structure and how you
can change anything to to make more
buttons less buttons and control their
order we're getting closer to actually
start coding with RAV API but before
we're going to do that we need to set up
your development environment and that's
what we're going to do in the next
lesson so you definitely don't want to
miss it out as well we'll download a few
ravit plugins we'll install pie charm
and visual studio code ID and set up R
API autocomplete so it's much easier for
you to code and reference the dock
strings and now I'm going to leave you a
little homework I want you to go to your
extension and clean it up remove what
you don't want maybe you don't want to
see this learn R API panel then you're
going to hold out click on it just go
out to the learn R API panel and delete
it right then when you go to Revit and
reload with P Revit it's going to be
gone so just organize it the way you
want it maybe prepare some buttons that
you want and I strongly recommend you to
leave the dev panel this def panel is
very often used for unfinished tools
this is where you create new tools you
work on them and once they ready you're
going to move them to any other panel
and now parit has finished reloading and
you can see this panel is gone and the
same way you can add more panels remove
panels and so on so I hope you enjoyed
this lesson and I want to wish you happy
coding and I'll see you in the next
lesson where we're going to set up your
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.