How to select and understand the Library?

Hi All,
I like to understand the selection of library while starting a particular script in python.

For Example.

import clr
import math
from Autodesk.Revit.DB import *

app = revit.Application
doc = revit.ActiveUIDocument.Document

Thanks to Nathan.

How he selected Revit API, RevitAPIUI as reference. or in other words how to check what is the use of that reference.

Is there any Basic Revit API reference document/video for Python(I can understand the workflow and scripting).

Thanks all.

1 Like

Hello Rajkumar!

This article explains a lot when it comes to how dynamo works with the revit api:

The Revit API uses .NET assemblies to give access to functionalities in the program, these assemblies are .dll files. RevitAPI.dll and RevitAPIUI.dll are files that can be found in the Revit program folder.

To use .NET with python Dynamo uses a variant called IronPython. How clr and clr.AddReference work is explained in the IronPyton documentation:

Finally when you do from Autodesk.Revit.DB import * you import all the classes in the Autodesk.Revit.DB Namespace, and thats where most of the Classes (Methods etc.) you can use in Revit are. Se all classes in DB here:


@Einar_Raknes Great Link ! thanks!

Thank you very much Einar…

Thanks Einar for the response and links!

In addition to the above, these examples may be of use to you as they describe what is happening.

The repo was started by Sol and has a few contributors.