Console

When using Patchwork 3D console (Scripting ‣ Console menu), the interpreter is initialized with the following script:

from p3dsdk import *
p3d = CurrentP3DSession()

So you can send commands to the running Patchwork 3D instance using the p3d variable.

The following function is also defined for convenience:

run_script(filename, modify_environment=False)

Run a Python script in Patchwork 3D.

Parameters
  • filename (str) -- Filename of the script to execute.

  • modify_environment (bool) -- Whether to change the console environment (e.g. global variables) from the script.