Python Nodes Basics

This post is a selection of COMMENTED SCRIPTS:
http://www.revitapidocs.com/code/

1 Like

Totally agree, but the main problem in the forum is that some users are still doing the work of some lazy people.

Regards,

2 Likes

@Organon
I can’t resist to cite your very first lesson to coding in this thread 'cause I simply love it :grinning:

4 Likes

@Yna_Db,

Hahaha, it’s the hard truth.

Regards,

1 Like

… so much easier to say with a touch of humor :grin:

3 Likes

To complement this IF-ELSE STATEMENT proposal, here are a few additional examples:

The following posts are related to PYTHON LISTS:

2 Likes

These posts relate to STRINGS in Python:

This post is about FUNCTIONS:

https://forum.dynamobim.com/t/passing-nodes-as-functions-in-python-script/16324/4

I wrote a 30 page handout for my AU class on Python for Dynamo, thought I would leave this here

13 Likes

This is a very good document that let you get started with a clear view on the possibilities opened by this language, along with a few tips that will make it all fun from the start. I add a link into the introductory post so it can be found easily. Thanks a lot :grinning:

Hooray for this post

It seems consistent to add this other nice tutorial here:

7 Likes

I think that this post can contribute to this topic :slight_smile:

3 Likes

For a non-programmer like myself, which would be the natural course then?
I am assuming first learning the basics of Python, for which I am following some course on edX and reading some tutorials, but this doesn’t seem to relate to geometric or graphical capabilities at all (Which I assume is because of the introductory level of the course).
So what would be next after learning the basic stuff?
How can I connect Revit or Dynamo or both to Python? This is like the missing link for me. I am sure you will guide me, and many others after me, on the right path.
Thank you all.

For most Dynamo users, I would say that Python only really shines when dealing with lists (especially of multiple levels) and Revit API work (which are things usually done in C# but can be done in python nodes). For geometric capabilities, I can only think of python being useful for its import libraries, math functions/capabilities, looping, or if you can find a python function online that already has what you want.

Someone please correct me if I am wrong though.

1 Like

If your into Python but need to check your syntax occasionally,
check out this Beginners Python Cheat Sheet,
beginnersPythonCheatSheet.pdf (1.7 MB)

downloaded from Eric Matthes author of Python Crash Course
http://ehmatthes.github.io/pcc/cheatsheets/README.html

lots of free resources available above but considering Eric went to the bother of making the cheet sheet free why not link to his book, I might even buy it myself…

with thanks to @DiRoots for twitter and @jose.oliveiraJXEPU for linkedin posts

4 Likes

THANK YOU!! :slight_smile:

really appreciated :sunglasses:

Python use in Dynamo is really growing which is a good sign. Here’s a my AU class about using Python for Dynamo which is meant to build up your skills with the software. It starts from basic fundamentals and builds to more complex examples.

2 Likes

Great compilation of information! Thank you to all contributors!