PolygonInteractor
Canonical path: ScriptObjectInteractors.PolygonInteractor.PolygonInteractor
Bases: BaseScriptObjectInteractor
implementation of the interactor for the polygon input
Methods:
-
__init__–Create the interactor
-
draw_preview–draw the preview
-
flatten_polygon–Removes the Z coordinate from all vertices of the polygon
-
on_cancel_function–Handles the cancel function event (triggered e.g. by hitting ESC, ...)
-
on_mouse_leave–Handles the mouse leave event
-
on_preview_draw–Handles the preview draw event
-
process_mouse_msg–Process the mouse message event
-
start_input–start the input
__init__
__init__(
interactor_result: PolygonInteractorResult,
common_prop: CommonProperties = GetCurrentCommonProperties(),
z_coord_input: bool = True,
multi_polygon_input: bool = True,
preview_function: Callable[[Polygon3D], ModelEleList] | None = None,
)
Create the interactor
Parameters:
-
interactor_result(PolygonInteractorResult) –result of the interactor
-
common_prop(CommonProperties, default:GetCurrentCommonProperties()) –common properties for the polygon preview
-
z_coord_input(bool, default:True) –allow input of a 3d polygon
-
multi_polygon_input(bool, default:True) –multi polygon input
-
preview_function(Callable[[Polygon3D], ModelEleList] | None, default:None) –function for generating preview elements during the input
draw_preview
draw_preview(polygon: Polygon3D)
flatten_polygon
staticmethod
on_cancel_function
on_cancel_function() -> OnCancelFunctionResult
Handles the cancel function event (triggered e.g. by hitting ESC, ...)
Returns:
-
OnCancelFunctionResult–True/False for success.
process_mouse_msg
process_mouse_msg(mouse_msg: int, pnt: Point2D, msg_info: Any) -> bool
Process the mouse message event
Parameters:
-
mouse_msg(int) –mouse message ID
-
pnt(Point2D) –input point in Allplan view coordinates
-
msg_info(Any) –additional mouse message info
Returns:
-
bool–True/False for success.
start_input
start_input(coord_input: CoordinateInput)
start the input
Parameters:
-
coord_input(CoordinateInput) –API object for the coordinate input, element selection, ... in the Allplan view