Skip to content

ModifyPythonPartUtil

implementation of the utility class for the PythonPart modification

ModifyPythonPartUtil

Canonical path: Utils.PythonPart.ModifyPythonPartUtil.ModifyPythonPartUtil

Bases: BaseScriptObjectInteractor, BaseInteractor

implementation of the utility class for the PythonPart modification

__init__

__init__(python_part: BaseElementAdapter)

initialize

Parameters:

modify_element_property

modify_element_property(page: int, name: str, value: Any)

Handles the modify element property event.

This event is triggered with each modification of the element property done in the property palette or by using a handle.

Parameters:

  • page (int) –

    Page of the modified property

  • name (str) –

    Name of the modified property.

  • value (Any) –

    New value of the modified property.

on_cancel_function

on_cancel_function() -> bool

Handles the cancel function event

This event is triggered when the ESC button is hit during the runtime of the PythonPart.

Returns:

  • bool

    True when the PythonPart framework should terminate the PythonPart, False otherwise.

on_control_event

on_control_event(event_id: int)

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

on_mouse_leave

on_mouse_leave()

Handles the mouse leave event.

This event is triggered, when the mouse leaves the viewport.

on_preview_draw

on_preview_draw()

Handles the preview draw event.

This event is triggered, when an input in the dialog line is done (e.g. input of a coordinate).

on_value_input_control_enter

on_value_input_control_enter() -> bool

Handles the value input control enter event.

This event is triggered, when enter key is hit during the input inside the input control located in the dialog line.

Returns:

  • bool

    True/False for success.

process_mouse_msg

process_mouse_msg(mouse_msg: int, pnt: Point2D, msg_info: Any) -> bool

Handles the process mouse message event.

This event is triggered with each message sent by the mouse, which can be a mouse move, mouse click, zoom out, etc. The message is sent only during mouse actions inside a viewport.

Parameters:

  • mouse_msg (int) –

    The mouse message.

  • pnt (Point2D) –

    The input point in view coordinates. The origin is the mid point of the viewport

  • msg_info (Any) –

    additional message info.

Returns:

  • bool

    True/False for success.

start_input

start_input(coord_input: CoordinateInput)

start the modification

Parameters:

  • coord_input (CoordinateInput) –

    API object for the coordinate input, element selection, ... in the Allplan view

Placeholder