Python Documentation

Python Documentation

mmaso64U7Y
Enthusiast Enthusiast
1,428 Views
1 Reply
Message 1 of 2

Python Documentation

mmaso64U7Y
Enthusiast
Enthusiast

Hello everyone,

 

I've just started coding with Revit API using Python. I'm a little lost since it seems that there is no official Python documentation, furthermore, the Python interface is not consistent with the C#, VB and c++ interface from the docs. For instance, from the documentation, the following method is for getting a parameter (C#):

public Parameter GetParameter(
	ForgeTypeId parameterTypeId
)

 

But in my Python code, GetParameter throws a TypeError (No method matches given arguments) while get_Parameter is working fine.

 

I can inspect the Python interface using dir, inspect or pydoc, but it is very slow procedure and it lacks of descriptions or signatures.

 

Is there a Python documentation with a roadmap of the API and deprecated interface?

0 Likes
1,429 Views
1 Reply
Reply (1)
Message 2 of 2

jeremy_tammik
Alumni
Alumni

The Revit API is based on .NET. There is only one single API, and it is identical for all programming languages. The entire API is documented in the Revit API help file RevitAPI.chm included in the official Revit SDK (Software Developer Kit) that can be downloaded from the Revit developer centre:

  

  

The API documentation is also available online:

  

  

The latter is generated from the former.

  

The get_ prefix is an artefact of the Parameter property:

  

  

It is a propery, yet takes an agument, so both C# and Python add the prefix to it in order to pass in an argument:

  

  

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
0 Likes