BaseScriptObject
Canonical path: BaseScriptObject.BaseScriptObject
Bases: ABC
, BaseScriptObjectData
implementation of the script object base class
script_object_interactor
property
writable
script_object_interactor: BaseScriptObjectInteractor | None
get the script object interactor
Returns:
-
BaseScriptObjectInteractor | None
–script object interactor
__init__
__init__(script_object_data: BaseScriptObjectData)
Initialization of class TextExample
Parameters:
-
script_object_data
(BaseScriptObjectData
) –script object data
execute
abstractmethod
execute() -> CreateElementResult
modify_element_property
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:
-
handle_prop
(HandleProperties
) –handle properties
-
input_pnt
(Point3D
) –input point
Returns:
-
CreateElementResult
–created element result
on_cancel_function
on_cancel_function() -> OnCancelFunctionResult
Handles the cancel function event (e.g. by ESC, ...)
Returns:
-
True
(OnCancelFunctionResult
) –cancel the input
-
False
(OnCancelFunctionResult
) –continue the input
-
None
(OnCancelFunctionResult
) –in case of not implemented
on_control_event
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
Process the input undo event
Returns:
-
bool
–message was processed: True/False
on_shortcut_control_input
Handles the input inside the shortcut control
Parameters:
-
_value
(int
) –shortcut value
Returns:
-
bool
–True/False for success.
on_value_input_control_enter
Process the enter inside the value input control
Returns:
-
bool
–message was processed: True/False
set_text_for_palette_modification
set an input text for a modification by palette
Parameters:
-
text
(str
) –input text
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