Python imports


#1

Hi guys!

Im slowly getting into the python scripting in Dynamo, but i cant figure out, or find anywhere a documentation of often imported modules. Could anybody enlight me?

<span style=“font-weight: bold; color: #f92672;”>import</span> clr
clr.<span style=“font-weight: bold; color: #ffffff;”>AddReference</span>(<span style=“color: #e6db74;”>‘ProtoGeometry’</span>)
<span style=“font-weight: bold; color: #f92672;”>from</span> Autodesk.DesignScript.Geometry <span style=“font-weight: bold; color: #f92672;”>import</span> *

clr.<span style=“font-weight: bold; color: #ffffff;”>AddReference</span>(<span style=“color: #e6db74;”>“RevitAPI”</span>)
<span style=“font-weight: bold; color: #f92672;”>import</span> Autodesk

clr.<span style=“font-weight: bold; color: #ffffff;”>AddReference</span>(<span style=“color: #e6db74;”>“RevitServices”</span>)
<span style=“font-weight: bold; color: #f92672;”>import</span> RevitServices
<span style=“font-weight: bold; color: #f92672;”>from</span> RevitServices.Persistence <span style=“font-weight: bold; color: #f92672;”>import</span> DocumentManager
<span style=“font-weight: bold; color: #f92672;”>from</span> RevitServices.Transactions <span style=“font-weight: bold; color: #f92672;”>import</span> TransactionManager

clr.<span style=“font-weight: bold; color: #ffffff;”>AddReference</span>(<span style=“color: #e6db74;”>“RevitNodes”</span>)
<span style=“font-weight: bold; color: #f92672;”>import</span> Revit
clr.<span style=“font-weight: bold; color: #ffffff;”>ImportExtensions</span>(Revit.Elements)

I know that the Protogeometry represents all the geometry made in Dynamo, but rest?

Thanks in advance for help!


#2

import clr
clr.AddReference(‘ProtoGeometry’)
from Autodesk.DesignScript.Geometry import *

Import DocumentManager and TransactionManager

clr.AddReference(“RevitServices”)
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

Import RevitAPI

clr.AddReference(“RevitAPI”)
import Autodesk
from Autodesk.Revit.DB import *

 

sorry for the mess!


#3

Pawel,

These are the most used imports:

Thank you,


Python Nodes Basics
#4

Thanks a lot!