Use the StepInto Option

You can debug your macros by using the StepInto option in Macro Manager.

  1. Open the code for your macro in the IDE.
  2. You can optionally set breakpoints in the macros. Click in the left margin of the code window, or click in the code and press F9 or Toggle Breakpoint in the Debug menu. Break points will display as red circles.
  3. In the Macro Manager, select your macro from the categorized list, and click StepInto. The IDE will enter debug mode and stop the macro at the first line.
    • Press F10 to step through the macro code, line by line.
    • Press F5 or Continue to move the next breakpoint if they were set in Step 2.
    Danger: Avoid switching Windows users or allowing Windows to enter sleep mode while using StepInto. In some cases, this can cause errors and unexpected data loss.
  4. In the Revit macro IDE, you can use Watch, Locals, and other options to perform debugging tasks like checking variable values. For more debugging information, see the IDE Help.

Note: Currently Module_Startup and Module_Shutdown cannot be debugged. The module must be loaded before debugging begins.