Debugging Python Code

Hi @Racel_Williams. Sorry I missed your second msg. I don’t really know C# well enough to be able to contribute to Core at this time, but anyone is more than welcome to borrow from this and create better implementations.


A few people asked me for clarification on how to use the Console, so I am adding more details below:

How to use RPW’s Console to debug python code:

1. Install RevitPythonWrapper (rpw) through the package manager

Note: Note that rpw package ships with a GettingStarted.dyn you can use to familiarize yourself with how it’s used withing Dynamo.

2. Build the graph below using RPW_GetFilePath and python node.

import sys
sys.path.append(IN[0]) # Assumes RPW_GetFilePath output is IN[0]

from rpw.ui.forms import Console

for i in range(10):
	if i ==5:
		Console(context=locals())

8 Likes