Python Nodes Basics

learning

#1

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:
http://dynamoprimer.com/en/09_Custom-Nodes/9-4_Python.html
http://dynamoprimer.com/en/09_Custom-Nodes/9-5_Python-Revit.html
http://dynamoprimer.com/en/12_Best-Practice/12-1_Scripting-Strategies.html
http://dynamoprimer.com/en/12_Best-Practice/12-3_Scripting-Reference.html
http://dynamoprimer.com/en/Appendix/A-1_resources.html














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

This second post relates to IMPORTS:












#3

This third post is about REVIT API and C# TO PYTHON:
https://forums.autodesk.com/t5/revit-api-forum/bd-p/160
http://www.revitapidocs.com/2017.1/
http://www.revitapidocs.com/code/#Python
http://www.revitapidocs.com/code/#Python_ConvertToPython-py
http://thebar.cc/converting-revit-api-c-code-to-python/
http://usa.autodesk.com/adsk/servlet/index?siteID=123112&id=2484975








#4

@Yna_Db

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

Thnx
Marcel


#5

Totally agree :slight_smile:
This post relates to IRONPYTHON and its LIBRARIES:
http://ironpython.net/
http://www.ironpython.info/index.php?title=Useful_Links
http://opensimulator.org/git/opensim-libs-save/IronPython/IronPython-1.1.1/Tutorial/Tutorial.htm
https://ironpython-test.readthedocs.io/en/latest/
https://stackoverflow.com/questions/590007/python-or-ironpython
https://stackoverflow.com/questions/17081821/python-vs-iron-python
https://ironpython-test.readthedocs.io/en/latest/library/index.html
https://docs.python.org/2/library/intro.html
http://ironpython.net/documentation/dotnet/




#6

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








#7

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

Regards,


#8

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


#9

@Yna_Db,

Hahaha, it’s the hard truth.

Regards,


#10

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


#11

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








#12

The following posts are related to PYTHON LISTS:




















https://stackoverflow.com/questions/35515996/revit-api-dynamo-handling-variable-input-types


Set Render Color from Material
Expected View, Got List, Python Error
#13

These posts relate to STRINGS in Python:








https://stackoverflow.com/questions/1546226/a-simple-way-to-remove-multiple-spaces-in-a-string-in-python


#14

This post is about FUNCTIONS:










#15

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


#16

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:


#17

Hooray for this post


#18

It seems consistent to add this other nice tutorial here: