Skip to content

Execute a PythonPart script created by VisualScripting

An interactor PythonPart can execute a PythonPart script created by Visual Scripting. This makes it possible, for example, to use existing VS-PythonPart scripts and combine them with the placement functionality provided by an interactor PythonPart.

The integration of the VS-PythonPart in the interactor script can be done by using VisualScriptService. This service class allows to:

  • load and initialize the VS-PythonPart script
  • load and save the favorite data
  • process the parameter modification and the control events
  • get the created elements for the preview drawing
  • create a PythonPart from the script

Example

For a complete usage of VisualScriptService, see the example ExecuteVisualScript located in:

  • …\etc\Examples\PythonParts\InteractorExamples\General\ExecuteVisualScript.pyp
  • …\etc\PythonPartsExampleScripts\InteractorExamples\General\ExecuteVisualScript.py