Revit API Forum
Welcome to Autodesk’s Revit API Forums. Share your knowledge, ask questions, and explore popular Revit API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Python Documentation

1 REPLY 1
Reply
Message 1 of 2
mmaso64U7Y
120 Views, 1 Reply

Python Documentation

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?

Labels (2)
1 REPLY 1
Message 2 of 2
jeremy_tammik
in reply to: mmaso64U7Y

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

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Customer Advisory Groups


Rail Community