BIM Q&A | How to Use the Revit API to Call Your Own External Custom Commands
Within the Revit API, you can invoke commands available on the Revit interface through IExternalCommand.
The main method for this is PostCommand.
Each function button on the Revit interface has a unique ID, which you can leverage to call the command programmatically.
For example:
The Wall tool has the ID "ID_OBJECTS-WALL".
The corresponding RevitCommandId can be retrieved by:
RevitCommandId.LookupCommandId("ID_OBJECTS-WALL");
Additionally, the Revit API provides a PostableCommand enumeration, which includes a set of commands readily available for developers to use.















Must log in before commenting!
Sign Up