======= Console ======= When using Patchwork 3D console (:menuselection:`S&cripting --> Console` menu), the interpreter is initialized with the following script: .. code-block:: python3 from p3dsdk import * p3d = CurrentP3DSession() So you can send commands to the running Patchwork 3D instance using the :py:data:`p3d` variable. The following function is also defined for convenience: .. py:function:: run_script(filename, modify_environment=False) Run a Python script in Patchwork 3D. :param filename: Filename of the script to execute. :type filename: str :param modify_environment: Whether to change the console environment (e.g. global variables) from the script. :type modify_environment: bool