pyux.identify_coordinate - pytha-3d-cad/pytha-lua-api GitHub Wiki

Identifies the snapped 3D coordinate at the given cursor position.

pyui.identify_coordinate(coos_vp, [selection_elements,] [excluded_elements])

Parameters

Type Description
coos_vp {u, v} Normalized viewport coordinates of the mouse cursor.
selection_elements {element_handle_1, ...} Optional: A table of element handles that are exclusively considered in the selection. May be nil.
excluded_elements {element_handle_1, ...} Optional: A table of element handles that are excluded from the selection. May be nil.

Return value

Type Description
res {...} A table containing the following information about the snapped 3D coordinate:
res.coos {x,y,z} Snapped coordinate.
res.part element_handle An element handle to the identified part. nil if no part was snapped.
res.normal {x,y,z} Normal vector of the picked face. nil if snapped point is not on a face.

Notes:

The coos_vp coordinates are solely to be received from one of the mous picking and dragging handler function calls such as set_on_left_click_handler or set_on_left_dragstart_handler.

selection_elements may be nil, in this case all parts are considered in the selection.

See also

pyux, identify_part, identify_plane, set_on_left_click_handler, set_on_right_click_handler, set_on_left_dragstart_handler, set_on_left_dragmove_handler, set_on_left_dragend_handler