class mhi.pscad.Definition

Component Definition

property project_name: str

The project which defines this definition (read-only)

property scope: str

The project which defines this definition (read-only)

property name: str

Name of the definition (read-only)

property scoped_name: str

The scoped definition name is the project and definition names, separated by a colon (read-only)

property instances: int

Number of live instances of this definition (read-only)

New in version 2.8.

property xml

XML for the Definition (read-only)

is_module() bool

Check to see if this component has its own canvas, with in turn, can contain additional components.


True if the component has an internal canvas, False otherwise.

Return type:


parameters(*, name=None, desc=None, url=None, group=None, tags=None) Optional[Dict[str, str]]

Set or get the definition’s parameters.

  • name (str) – The definition name. Must be unique, alphanumeric, and a maximum of 30 characters

  • desc (str) – A short description for the definition

  • url (str) – Location if loaded from an external resource

  • group (str) – One or more labels to describe group categorization (Comma separated)

  • tags (str) – One or more tags to help find this definition (Comma separated)


A dictionary of parameter values (if no parameters are being set), or None.

compile() None

Compile this component definition page

navigate_to() Canvas

Attempt to navigate to the first instance if possible


The definition’s canvas

Return type:


set_view(view: Union[str, View]) None

Activate the appropriate definition editor tab

Valid view tabs are one of the strings: “Schematic”, “Graphic”, “Parameters”, “Script”, “Fortran”, “Data”, or the equivalent View constant.


view – The desired view tab

canvas() Canvas

Definition canvas

graphics() GfxCanvas

Get the graphics canvas

New in version 2.2.

copy() None

Copy the definition to the clipboard.

property script

The definition’s script sections are accessed with this property.


checks = defn.script['Checks']       # Get script section
defn.script['Computations'] = "..."  # Add/Change script section
del defn.script['FlyBy']             # Delete script section

New in version 2.2.