Autodesk Revit offers an open API data interface that allows users to customize and develop software tailored to their specific functional needs, significantly enhancing design efficiency. When performing secondary development in Revit, developers need to implement specialized interfaces within their plugins. The API primarily provides two main interface types: the external command interface and the external application interface.

1. IExternalCommand: New commands developed using this interface appear under the External Tools menu within the Add-Ins tab. This interface contains a single abstract method, Execute(), which accepts one input parameter and returns two output parameters. The input parameter is CommandData of type ExternalCommandData. The output parameters include message (a string) and elements (an ElementSet). The plugin’s functionality is activated by overriding this method.
2. External Application Interface (IExternalApplication): Customized features built using this interface automatically create a new feature panel under the Add-Ins tab when Revit starts. It defines two abstract methods of type UIControlledApplication: OnStartup and OnShutdown. The UIControlledApplication class does not provide direct access to Revit documents; however, developers can implement custom behavior during Revit’s startup and shutdown phases by overriding these methods.
Revit secondary development can be approached through two modes. One option is to create personalized features using API-defined macros within the VSTA environment bundled with Revit. Alternatively, developers can use Microsoft Visual Studio 2015 combined with the Microsoft .NET Framework 4.6, employing languages such as C#, VB.NET, or C++. Due to its simpler structure and advantages over C++ and VB, C# is generally preferred for Revit secondary development. To access Revit API functionality, developers reference two dynamic link libraries located in the Revit installation directory: RevitAPI.dll and RevitAPIUI.dll.














Must log in before commenting!
Sign Up