Skip to content

BaseScriptObject

Canonical path: BaseScriptObject.BaseScriptObject

Bases: ABC, BaseScriptObjectData

implementation of the script object base class

document property

document: DocumentAdapter

get the document

Returns:

script_object_interactor property writable

script_object_interactor: BaseScriptObjectInteractor | None

get the script object interactor

Returns:

__init__

__init__(script_object_data: BaseScriptObjectData)

Initialization of class TextExample

Parameters:

execute abstractmethod

execute() -> CreateElementResult

execute the script

Returns:

modify_element_property

modify_element_property(_name: str, _value: Any) -> bool

Modify property of element

Parameters:

  • _name (str) –

    the name of the property.

  • _value (Any) –

    new value for property.

Returns:

  • bool

    palette update state

move_handle

move_handle(
    handle_prop: HandleProperties, input_pnt: Point3D
) -> CreateElementResult

Modify the element geometry by handles

Parameters:

Returns:

on_cancel_function

on_cancel_function() -> OnCancelFunctionResult

Handles the cancel function event (e.g. by ESC, ...)

Returns:

on_control_event

on_control_event(event_id: int) -> bool

Handles the on control event

Called when an event is triggered by a palette control (ex. button).

Parameters:

  • event_id (int) –

    event id of the clicked button control

Returns:

  • bool

    True, when palette should be updated. False otherwise.

on_input_undo

on_input_undo() -> bool

Process the input undo event

Returns:

  • bool

    message was processed: True/False

on_shortcut_control_input

on_shortcut_control_input(_value: int) -> bool

Handles the input inside the shortcut control

Parameters:

  • _value (int) –

    shortcut value

Returns:

  • bool

    True/False for success.

on_value_input_control_enter

on_value_input_control_enter() -> bool

Process the enter inside the value input control

Returns:

  • bool

    message was processed: True/False

set_text_for_palette_modification

set_text_for_palette_modification(text: str)

set an input text for a modification by palette

Parameters:

  • text (str) –

    input text

start_input

start_input()

start the input

Overload this member function in the case where a script object interactor (e. g. for an element selection) needs to be started before the script execution

start_next_input

start_next_input()

start the next input

Overload this member function to execute the needed steps after the execution of a script object interactor (e. g. after an element selection)

Placeholder