I'm starting to learn Python (and Dynamo) and encounter the problem of how to learn to use it for my actual needs in Revit. I got a whole bunch of Python books from the library. One problem is the books are either focused on examples to make simple videogames, or are way to advanced (and also not based on examples one would use in Revit). I have to admit, some children-oriented books were easier to understand 🙂
There is a "Dynamo for Revit: Python Scripting" book, but that is not actually available. Are there actually books or sources that would teach Python on examples one would use for Revit/dynamo? I'm learning best on an example i actually use.
I also found there is a Python shell for Revit from github, but none for Revit 2021. Is there something similar? I saw some videos of how one can do some useful things in Revit.
Solved! Go to Solution.
Solved by jeanmarc.couffin. Go to Solution.
The best and most up to date sources tend to be online these days. The second source is for RPS as you mentioned but would probably be my starting point for something specific to Revit.
IntroductoryBooks - Python Wiki
Introduction · Scripting Autodesk Revit with RevitPythonShell (gitbooks.io)
People seem really passionate Python don't they. I'm no expert on this so maybe people have good book suggestions but I prefer online for all aspects of learning generally.
Hey,
To start with Python and Dynamo, I think this Autodesk University Class by Gui Talarico is a great resource:
If you have some basis but you don´t know how to move on, a good way to learn Python applying to Dynamo is to download 3rd party packages ( Archilab, Clockwork, Lunchbox, Rhythm, Bimorph, Spring nodes, etc) and read the code that the nodes contain. You will see really good implementations and good practices. You will be able to see how others think about problems and write the solutions.
Have a good understanding of Object-oriented programming will help you on this and is a key aspect to understand how to use the Revit API with Python.
About the resources, as is mentioned in the previous posts, I would take a look on Linkedin learning and also on https://thinkparametric.com/ . There are good courses there.
Good luck!
RevitPythonShell for Revit 2020 works just fine in Revit 2021 as well:
https://github.com/architecture-building-systems/revitpythonshell/issues/106
Thanks all. I'll digest what was offered.
So far the "Automate the Boring Stuff with Python" book seems to be the best i could find in the library. So I guess I will look more and start to dig deeper when I create some dynamo programs.
I won't be able to install the Python shell in Revit. Since that is free, they don't really provide the security certificates our IT requires to allow installation. My hope is Revit will include it at some point (since Autodesk is already approved by IT). Until then I have to limit myself to the Python in dynamo nodes.
If you have Revit installed, Python is included: it is supported by the built-in Revit macro IDE (integrated development environment).
You mean the Macromanager?
I haven't done anything with that yet. So if that does what the Pythonshell does, I use what i already have.
The macro manager does not quite do the same thing as RPS.
RPS provides a REPL, read-evaluate-print loop:
https://en.wikipedia.org/wiki/Read%E2%80%93eval%E2%80%93print_loop
That enables you to interactively program something, line by line, and execute each line as you type it.
The macro environment enables you to create and execute macros. That means that you have to complete an entire macro and compile it before it can be executed.
In any case, the simplest way forward for you would be to use what you have and work through a Revit macro tutorial first of all.
Thanks for the advice. I'll look into that.
I have a (growing) list of features or solutions I need in Revit and will try to work on solutions. Some will require some general Revit trickery, some dynamo, some macros etc. that way i will learn to sue the tools inc. Python.
try Kevin Himmelreich book https://www.amazon.com/M%C3%A1s-all%C3%A1-Dynamo-Manual-Spanish/dp/B08P1FCBZY
even though it is in spanish, you can understand most of the things written.
bunch of examples and pretty much everything about the revit api is covered in python
Thank. No , I don't speak (or read) Spanish. The amazon preview only showed 3 pages that didn't actually show any content. So I couldn't judge if the book would be useful without words.
It shows the cover, one that i assume says "this page is intended to be blank" and a page that tells the ISBN number of the book. Whoever decided on which page to shows really wants us to buy the book to learn the secret 🙂
Thanks for posting. I fear I would miss a lot by not being able to read the text.
My hope is they translate that at some point. With the lack of books, it must be a good seller.
I bought the Dynamo cheat sheet book and while that isn't the best book for learning (besides the fact half the book is for Grasshopper, and programming examples are in C#), it helped me to get started with Dynamo.
You should also check out Jacob's Dynamo Learning Resources:
https://thebuildingcoder.typepad.com/blog/2021/02/addin-file-learning-python-and-ifcjs.html#3.1
Just added to the blog...
Best ones are
You can check this post for more best Python Books(Found this list on the Internet)
Thanks for the advice! I found two books by Shaw Zed in my local library and ordered them.