Skip to main content
Version: 2026R2

Script

class compolyx.Script(name, *, parent=None, source=None, active=True, uptodate=False, update_mode=ScriptUpdateMode.ON_TRIGGERS)

Class to represent user-defined scripts operating on the input parameters.

Attributes

NameDescription
Script.activeWhether the script should run or not
Script.enabledWhether this object is currently enabled or not
Script.is_dict_itemSpecifies whether the object is an item of a dict
Script.is_list_itemSpecifies whether the object is an item of a list
Script.link_pathRoot path of the current node in the tree for links to this object
Script.nameName of object
Script.parentParent object in tree
Script.root_pathRoot path of the current node in the tree
Script.sourceSource code of the user-defined script
Script.statusString status indicating if the object is up-to-date
Script.status_changedSpecifies if the object has changed, for the purposes of notifying the Workbench application.
Script.update_modeDefines which changes cause the script to become out-of-date
Script.uptodateWhether the script execution is up to date

Methods

NameDescription
Script.find_parent(type)Function steps up the tree and returns the first parent with given type
Script.run()
Script.serialize()Serialize to Python string
Script.source_default()
Script.update()
Script.visit(visitor)Walk through the tree and let the visitor perform action on every descendant node