Reflection Examples for Revit APi

Reflection Examples for Revit APi

Troy_Gates
Advocate Advocate
1,073 Views
1 Reply
Message 1 of 2

Reflection Examples for Revit APi

Troy_Gates
Advocate
Advocate

As a casual Revit API developer I am always looking for new ways to improve my code and knowledge. I have seen a few references now to using Reflection to speed up code in the Revit API. I have researched Reflection on the web and have a general idea of what its used for but couldn't find any examples of its use in reference to the Revit API.

 

Does anyone have any examples of Reflection with the Revit API that I could take a look at?

 

Thanks

0 Likes
Accepted solutions (1)
1,074 Views
1 Reply
Reply (1)
Message 2 of 2

jeremytammik
Autodesk
Autodesk
Accepted solution

Dear Troy,

 

Reflection will never speed up your code.

 

You can use it to make your code more flexible, though, e.g., adapt to situations, e.g., determine what version of the Revit API is currently loaded and switch between different version-specific implementations accordingly.

 

A couple of examples of doing that:

 

 

I am unaware of any Revit API Reflection samples outside of The Building Coder blog, which offers a few more besides those listed above.

 

Cheers,

 

Jeremy



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder