Skip to content

Debugging python script in cadwork
This section refers to calling the plugins from the Plugin Bar. If you want to debug a script in cadwork, then you can enable the console in User Test in the user settings. When cadwork is restarted, the console opens. In the console you will see the screen output, or errors.

User Test -> Userprofile -> Test Options... -> Console



Bugs present in the script can be detected in the console.

Any print statements are also visible in the console.

print("hello world")

Print output in console:


Displayed Bug in console:


or use the debugger from Python IDLE.


Pycharm Professional

Remote debugging with the Python remote debug server configuration

Pycharm debug server configuration 💡

  • Install the pydevd-pycharm package on the remote machine by running the following command:

pip install pydevd-pycharm~=

for example, pip install pydevd-pycharm~=191.3490)

  • Modify the source code file as follows:
import math
#==============this code added==================================================================:
import pydevd_pycharm

pydevd_pycharm.settrace('', port=12345, stdoutToServer=True,
class Solver:

    def demo(self, a, b, c):
        d = b ** 2 - 4 * a * c
        if d > 0:
            disc = math.sqrt(d)
            root1 = (-b + disc) / (2 * a)
            root2 = (-b - disc) / (2 * a)
            return root1, root2
        elif d == 0:
            return -b / (2 * a)
            return "This equation has no roots"

if __name__ == '__main__':
    solver = Solver()

while True:
    a = int(input("a: "))
    b = int(input("b: "))
    c = int(input("c: "))
    result = solver.demo(a, b, c)