Python Nodes Basics


I noticed it might be useful to gather some Python related posts in one thread to make it easy to get started with some basic understanding (and also for a consultation ease purpose). This is still a work in progress and there might be some slight inconsistencies. Feel free to add your own links or Python related comments, or to PM me on anything that should be revised. This first post relates naturally to tips for LEARNING PYTHON:

List Appearance Assets for Material
How to get entire code inside Python Script
Looking for a Simple Python script to create Table (solved without python)
[spring nodes] alter node "FamilyInstance.ByGeometry
Find nodes and packages in use in a graph
Modify Phyton Scripts
How to use Revit SDK?
Install Python library without pip
Learning Python
Python Cheat Sheet
The managed object is not valid - Dynamo crashes on 'TransactionManager.Instance.EnsureInTransaction(doc)'
Created nested lists with python
Override Element Colour/Color (but not line)
Automatic dimensioning of (multiple) detail lines
Create Elevation by Rooms
Links - "Reload From..."
Set analytical column Z Projection parameter
Getting started with Dynamo Studio 2016

This second post relates to IMPORTS:


This third post is about REVIT API and C# TO PYTHON:



Give a man a fish and he can eat for a day.
Give a man a fishingrod and he can eat for a lifetime.



Totally agree :slight_smile:
This post relates to IRONPYTHON and its LIBRARIES:


This post is a selection of COMMENTED SCRIPTS:

1 Like

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



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



Hahaha, it’s the hard truth.


1 Like

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


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


The following posts are related to PYTHON LISTS:

1 Like
Expected View, Got List, Python Error
Set Render Color from Material

These posts relate to STRINGS in Python:


This post is about FUNCTIONS:


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


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:


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


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.