BIM World
A Professional BIM Learning Platform


BIM Skills: Two Common Methods for Developing with Revit

There are two common development approaches for Revit: external commands and external applications. Both interfaces are included in the Revit API.dll package.

BIM skills | How to develop Revit? Two commonly used Revit development methods

External Command

Plugin developers can integrate their applications through the external command interface IExternalCommand. Revit recognizes external plugins via .addin files, and plugins can also be loaded directly using the Addin tool.

Using the external command design allows plugins to be re-invoked without restarting Revit, which simplifies debugging during plugin development. For this reason, the external command approach is adopted in the early stages of plugin design in this article.

The main modules developed include:

  • Automatic creation of axis network
  • Automatic generation of basic models
  • Parameter modification module for ANSYS
  • Data export module
  • Unreinforced extended basic calculation and verification module
  • Extended basic calculation and verification module
  • Automatic reinforcement module

Each module is implemented by creating a class based on the IExternalCommand interface and compiling it into a .dll file.

The IExternalCommand interface defines a single abstract method, Execute(), which can be overloaded to implement the command’s functionality. This Execute() method serves as the main entry point of the external command and accepts three parameters: commandData, message, and elements.

commandData is typically used to access the current Revit document being operated on. message is used to return error messages during execution. If the external command returns a status of Failed or Cancelled and the message parameter is not empty, the elements specified by the elements parameter will be highlighted in Revit.

BIM skills | How to develop Revit? Two commonly used Revit development methods

External Application

Alternatively, developers can create applications using the external application interface IExternalApplication. Like external commands, Revit detects external plugins through .addin files.

The IExternalApplication interface defines two abstract methods: OnStartup() and OnShutdown(). Developers can override these methods to customize behavior when Revit starts and shuts down.

In this article, the focus is on using the OnStartup() method to automatically load the “Basic Creation Module” tab and its buttons into the Revit toolbar upon startup. Clicking these buttons will trigger the corresponding IExternalCommand plugins created earlier.

To have the “Basic Creation Module” tab appear in the toolbar on startup, the necessary code must be placed within the OnStartup() method. Each module’s .dll file is assigned a button within this tab, allowing users to invoke the associated functionality directly by clicking the button.

xuebim
Follow the latest BIM developments in the architecture industry, explore innovative building technologies, and discover cutting-edge industry insights.
← Scan with WeChat
Like(0) 打赏
BIM WORLD » BIM Skills: Two Common Methods for Developing with Revit

Comment Get first!

Must log in before commenting!

 

BIM World, A Professional BIM Learning Platform

Stay updated on the latest architecture trends and share new building technologies.

Contact UsAbout Us

觉得文章有用就打赏一下小编吧

非常感谢你的打赏,我们将继续提供更多优质内容,让我们一起创建更加美好的网络世界!

支付宝扫一扫

微信扫一扫

Account Login

By signing in, you agree toUser Agreement

Sign Up