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
- In the Macro Manager dialog, select a macro and click
Edit.
- In Visual Studio Code, set the breakpoints for debugging.
- Click, Run Start Debugging. VSCode will attach to a Revit process. (Revit may become inoperable while VSCode is attaching.)
- When Revit becomes idle, click Run in the Macro manager.
- The breakpoint will be hit.
- 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.