Debug Macros

Search for and remove errors from macro code.

Use Visual Studio Code to set breakpoints and run code through the debugging process. Before a macro can be debugged, be sure you have built the macro successfully. See Create macros.

Debug a Macro

  1. In the Macro Manager dialog, select a macro and click Edit.
  2. In Visual Studio Code, set the breakpoints for debugging.
  3. Click, Run Start Debugging. VSCode will attach to a Revit process. (Revit may become inoperable while VSCode is attaching.)
  4. When Revit becomes idle, click Run in the Macro manager.
  5. The breakpoint will be hit.
  6. Click Disconnect to stop debugging. clicking Stop will stop debugging and close Revit.
    Note: Only one instance of Revit can be running in order to perform debugging.