PythonToolsInterface Class Reference

#include <pythontools.h>

Detailed Description

An interface to execute Python scripts. It executes code like Script Manager scripts so "doc" and "op" are based on the given BaseDocument.

Static Public Member Functions

static MAXON_METHOD Result< void > ExecuteCode (const String &scriptName, const String &sourceCode, BaseDocument *doc, const String &path)
 
static MAXON_METHOD Result< void > ExecuteScript (const Url &script, BaseDocument *doc)
 

Private Member Functions

 MAXON_INTERFACE_NONVIRTUAL (PythonToolsInterface, MAXON_REFERENCE_NONE, "net.sdktools.interfaces.pythontools")
 

Member Function Documentation

◆ MAXON_INTERFACE_NONVIRTUAL()

MAXON_INTERFACE_NONVIRTUAL ( PythonToolsInterface  ,
MAXON_REFERENCE_NONE  ,
"net.sdktools.interfaces.pythontools"   
)
private

◆ ExecuteCode()

static MAXON_METHOD Result<void> ExecuteCode ( const String scriptName,
const String sourceCode,
BaseDocument doc,
const String path 
)
static

Executes the given Python code.

Parameters
[in]scriptNameThe script name.
[in]sourceCodeThe Python source code.
[in]docThe BaseDocument to set "doc" and "op".
[in]pathThe path for "__file__".
Returns
OK on success.

◆ ExecuteScript()

static MAXON_METHOD Result<void> ExecuteScript ( const Url script,
BaseDocument doc 
)
static

Loads and executes the given Python script.

Parameters
[in]scriptThe Url of a Python script.
[in]docThe BaseDocument to set "doc" and "op".
Returns
OK on success.