Click or drag to resize

PythonScript Class

Represents a Python script.
Inheritance Hierarchy

Namespace:  Rhino.Runtime
Assembly:  RhinoCommon (in RhinoCommon.dll)
public abstract class PythonScript

The PythonScript type exposes the following members.

Protected methodPythonScript
Initializes a new instance of the PythonScript class.
Public propertyContextId
Gets or sets a context unique identified.
Public propertyOutput
Gets or sets the Python script "print()" target.

By default string output goes to the Rhino.RhinoApp.Write function. Set Output if you want to redirect the output from python to a different function while this script executes.

Public propertyScriptContextCommand
Command associated with this script. Used for localiation
Public propertyScriptContextDoc
object set to variable held in scriptcontext.doc.
Public propertyStatic memberSearchPaths
Get/Set additional search paths used by the python interpreter
Public methodStatic memberAddRuntimeAssembly
Add assembly to list of assemblies used by python
Public methodCompile
Compiles a class in a quick-to-execute proxy.
Public methodContainsVariable
Determines if the main scripting context has a variable with a name.
Public methodStatic memberCreate
Constructs a new Python script context.
Public methodCreateTextEditorControl
Creates a control where the user is able to type Python code.
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Public methodEvaluateExpression
Evaluates statements and an expression in the main scripting context.
Public methodExecuteFile
Executes a Python file. The file is executed in a new, __main__ scope.
Public methodExecuteFileInScope
Executes a Python file in the calling script scope. All old variables are kept.
Public methodExecuteScript
Executes a Python string.
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Protected methodGetSearchPaths
Protected helper function for static SearchPaths
Public methodGetStackTraceFromException
Retrieves a meaningful representation of the call stack.
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodGetVariable
Gets the object associated with a variable name in the main scripting context.
Public methodGetVariableNames
Retrieves all variable names in the script.
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodRemoveVariable
Removes a defined variable from the main scripting context.
Public methodStatic memberRuntimeAssemblies
Get list of assemblies used by python for library browser and inclusion into the runtime
Public methodSetIntellisenseVariable
Sets a variable for runtime introspection.
Protected methodSetSearchPaths
Protected helper function for static SearchPaths
Public methodSetupScriptContext
Setups the script context. Use a RhinoDoc instance unless unsure.
Public methodSetVariable
Sets a variable with a name and an object. Object can be null (Nothing in Visual Basic).
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
See Also