How do I start studying Dynamo Python?

hello.
When I want to create various nodes using Revit Dynamo, I sometimes need to install a package or a Python node, so I often want to implement the desired function by adding a user node using a Python node.
However, I have never studied Python before, so I would like to know at least one tip on how to start using it well.

Hey,

It’s great that you’d like to learn Python, I think the answer splits into 2 parts…

  1. Learn Python basics… Data types, manipulation, returning values, dealing with lists.
  2. Learn Python to use the Revit API to perform a task.

You could easily spend years just on 1, but have little to show for your efforts.

If you jump straight into 2, you’ll struggle to have any idea of what is going on.

So, I would recommend spending some time learning a basics Python course, (there are free ones, lots of YouTube videos, Code Academy etc.)

Then spend some time on a Python for Dynamo course (again, there are lots of free resources such as https://www.youtube.com/watch?v=0bhFIk1_UHU by @GavinCrump) .

Finally, you will then want to spend some time learning how C# is translated into Python, because the Revit API documentation is all in C#.

https://primer.dynamobim.org/10_Custom-Nodes/10-5_Python-Revit.html
eventually… VoltaDynaBim: Python

If you search the forum there is a huge repository of knowledge, so do dig around.

Hope that helps,

Mark

7 Likes

My recommendation is always along the lines of this (@Mark.Ackerley beat me to a few links so there are repeats, but additional perspectives provide more context which can help in knowing ‘why’ not just ‘what’):

  1. Learn Python basics first. The Dynamo implementation thereof is a subset of what you can do with Python and has some extra requirements and restrictions, but the general knowledge of “how to use Python” will help you immensely. It’s also something that can be done outside the context of your impending deadline and doesn’t risk messing with your project data as you get started. For this I recommend just searching “Python learning” in your phone’s app store and checking out what you find. The space moves so fast in terms of ‘who has what’ as the companies offering such attempt to make money in different ways that what works today doesn’t tomorrow without hefty fee and you shouldn’t have to pay for this beyond maybe seeing the occasional ad in the middle of the page (usually for a paid course). I believe I used SoloLearn and did the courses on my subway/bus rides to and from work. You can learn the basics you need this way in a few weeks, or if you do a deep dive you can do it in a day.

  2. From there learn to implement it in the context of Dynamo. I recommend starting with this chapter of the Dynamo Primer as it’s the most ‘current’ as many of the resources haven’t updated to the latest intricacies. The Dynamo Python Primer is also of use, as are the two relevant Dynamo Office Hour sessions on the topic - one on Python and one on the Revit API, and @GavinCrump’s youtube series for additional education. All in there are a plethora of sources here.

  3. Learn from examples which are out there. Several Dynamo packages such as @Alban_de_Chasteigner’s Genius Loci package, @Andreas_Dieckmann’s Clockwork package, and many more can help you see the great many ways various tasks can be accomplished in the real world. You should also read @c.poupin’s blog for some of the more impressive advanced Python work. There are also many great code repositories you can learn from, including @solamour’s Dynamo Python repo.

  4. Remember the Revit API is immense, and Python is a wrapper of a wrapper of a wrapper. As such some tasks just aren’t well suited for it - or even Dynamo - but most are. Stick to the basics at first and when you run into a roadblock ask about how to get around it on the forum. Even with all the wealth of expertise some things just can’t be done, so be prepared for such and plan on eventually moving into C# where the full API is accessible without conversion blockers (I wish I had done so much earlier in my journey).

11 Likes

The best way to learn python basics is through some AI. Deepseek is very good. I have found that the python for Dynamos needs may differ depending on which Dynamo version you using.

Going to disagree with you on this.

LLM based AI might be good at writing something which looks like real Python to accomplish a task which might work, and often can be made to work if you know what you’re doing. And it is likely very good at deciphering what existing Python scripts do in human language. And it can even be rather good at optimizing code…

However it won’t teach you Python. You’ll miss out on the ‘how to write’ part of the process, as well as how to navigate the documentation for the APIs you’ll use the most, or even core concepts of Python. All of which are a must for actually “learning” Python.

It certainly can help you feel like you’re getting work done quick, but in the long term it can hinder your capability.

As always, there are no shortcuts to becoming good at something.

5 Likes

Also going to disagree about using AI.
I love AI but don’t think it’s the best for learning something from scratch. It can show you things and help you improve, but to learn the absolute basics I’d say you need to start the old fashioned way with good old reading and making your own mistakes.

@jy.choiUWVHX I started with this one:
https://pythoninstitute.org/python-essentials-1

it’s FREE and was really good for a total beginner.

2 Likes

It does teach you the basics. Just ask it teach basics of python. But this is only if you have some sort of knowledge how to program, and its output is only as good as the question you ask it.

I suppose the best way is to take a step by step tutorial like below

https://www.learnpython.org/

1 Like

thank you The advantage is that you can learn step by step on the site.

After all, it is important to learn in detail one by one rather than learning quickly. Thank you for your reply.

I think it’s great that you know so much information and are able to share it with us. thank you