Definitions

class mhi.pscad.Definition

Component Definition

canvas() → Canvas

Definition canvas

compile() → None

Compile this component definition page

copy() → None

Copy the definition to the clipboard.

graphics() → GfxCanvas

Get the graphics canvas

New in version 2.2.

is_module() → bool

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

Returns

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

Return type

bool

property name

Name of the definition

navigate_to() → Canvas

Attempt to navigate to the first instance if possible

Returns

The definition’s canvas

Return type

Canvas

property project_name

The project which defines this definition (read-only)

property scope

The project which defines this definition (read-only)

property scoped_name

The scoped definition name is the project and definition names, separated by a colon.

property script

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

Examples:

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.

set_view(view: Union[str, mhi.pscad.automation.types.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.

Parameters

view – The desired view tab

property xml

XML for the Definition