BaseScriptObject
Canonical path: BaseScriptObject.BaseScriptObject
Bases: ABC, BaseScriptObjectData
implementation of the script object base class
Methods:
-
__init__–Initialization of class TextExample
-
create_library_preview–create the library preview
-
execute–execute the script
-
modify_element_property–Modify property of element
-
move_handle–Modify the element geometry by handles
-
on_cancel_function–Handles the cancel function event (e.g. by ESC, ...)
-
on_control_event–Handles the on control event
-
on_input_undo–Process the input undo event
-
on_shortcut_control_input–Handles the input inside the shortcut control
-
on_value_input_control_enter–Process the enter inside the value input control
-
process_mouse_move–Process the mouse move event
-
set_text_for_palette_modification–set an input text for a modification by palette
-
start_input–start the input
-
start_next_input–start the next input
Attributes:
-
document(DocumentAdapter) –get the document
-
script_object_interactor(BaseScriptObjectInteractor | None) –get the script object interactor
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
create_library_preview
create_library_preview() -> CreateElementResult
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)
Modify the element geometry by handles
Parameters:
-
_handle_prop(HandleProperties) –handle properties
-
_input_pnt(Point3D) –input point
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
process_mouse_move
process_mouse_move(_input_pnt: Point3D)
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