Revit API documentation and roadmap

Revit API documentation and roadmap

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

Revit API documentation and roadmap

mmaso64U7Y
Enthusiast
Enthusiast

Hi all,

I’ve been working with the Revit API for some time now, and I’ve come across some inconsistencies in method signatures that can be confusing. One example is the GetTypeId() method, which returns different types depending on the class:

public ElementId GetTypeId()  // Autodesk.Revit.DB.Element

and

public ForgeTypeId GetTypeId()  // Autodesk.Revit.DB.Parameter

This inconsistency isn't clearly explained in the official API documentation, and most of the resources I rely on are third-party, decompiled references like:

 

I’ve searched for an official explanation or documentation that clarifies this, but haven’t found anything concrete. I also came across this related post, unfortunately it hasn't been answered.

 

My question. Is there any official documentation that can provide a better understanding of the API?

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

TripleM-Dev.net
Advisor
Advisor

@mmaso64U7Y,

 

Yes, welcome to this Forge direction.

Personally I hate these ForgeTypeId's, broke a lot of my code and some functionality is totally gone or no actual (good) replacement for it.

I hard coded most common used types along with the old Enums, and translated to my own enums so I could keep R2017-R2024 the same source code.

 

I get what Autodesk is doing, but the many steps in between from Enums to ForgeId's is terrible.

They should have better changed it all in one go and kept the 2 versions for 2 or 3 years in the API with clear documentation of the transition.

Now each version between 2021-2024 had major breaks with a huge impact, specially for parameters.

 

Some explanation of the difference

Element and Parameter and not derived from each other so no real relation expected between them for GetTypeId result.

Also in context a Type of a Element can be various types or even none.

The type of a Parameter is predefined internally, the previously Enums, easy to recognise but now become a ForgeId which is a type on it's own, like "autodesk.revit.parameter:hostAreaComputed-1.0.0", and can no longer be easy compared like before with the enums.

 

For official documentation, nope those links you gave the sample files of the API SDK and this forum.

And there are several other sites with info, like https://thebuildingcoder.typepad.com/ 

 

- Michel