PyANGKernel.GKScript

class GKScript

Class that keeps a set of instructions that can be executed within Aimsun

Details

A script (as today in Python only) that resides in the model. It can be a command in the conext menu for a type of objects or in the list of scripts.

Inheritance diagram of PyANGKernel.GKScript

Synopsis

Methods

Static functions

Note

This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE

class ScriptType
__init__()
addImportedScript(script)
Parameters:

scriptGKScript

clearImportedScripts()
execute([target=None[, selection=None]])
Parameters:
  • targetGKObject

  • selectionQList

Execute this script. An optional target and selection list (that includes target) option can be set. If so it can be accessed from the script using the target variable and the selection variable.

executeBool(functionName[, target=None[, typeName="GKObject"]])
Parameters:
  • functionName – str

  • targetvoid

  • typeName – str

Return type:

bool

Execute this script. An optional target and selection list (that includes target) option can be set. If so it can be accessed from the script using the target variable and the selection variable.

getCode()
Return type:

str

The code.

getContextMenuType()
Return type:

str

a command in the conext menu for a type of objects

getFileName()
Return type:

str

Gets the filename where the script will be saved to if set to external. When non-empty the script will be external and when empty the script will be saved in the Aimsun document.

static getPathsFromSite()
Return type:

list of strings

returns all the paths defined in all .pth files located at Lib/site-packages

getScriptType()
Return type:

ScriptType

hasImportedScript(script)
Parameters:

scriptGKScript

Return type:

bool

static loadPythonEnvironmentalPaths([path=""])
Parameters:

path – str

removeImportedScript(script)
Parameters:

scriptGKScript

setCode(acode)
Parameters:

acode – str

The code.

setContextMenuType(atype)
Parameters:

atype – str

a command in the conext menu for a type of objects

setFileName(name)
Parameters:

name – str

Sets the filename where the script will be saved to if set to external. When non-empty the script will be external and when empty the script will be saved in the Aimsun document.

setImportedScripts(impScripts)
Parameters:

impScripts – .QSetGKScript

Set the imported scripts

setScriptType(type)
Parameters:

typeScriptType