osecore.gui.selection

Package for code relating to selection in GUI.

Name

Description

find_edge_in_selection_object

Find the first edge in the given selection object.

find_face_in_selection_object

Find the first face in the given selection object.

find_selection_object_by_type

Find the first selection object with the given object type.

find_vertex_in_selection_object

Find the first vertex in the given selection object.


find_edge_in_selection_object(selection_object: FreeCADGui.SelectionObject) → Optional[Part.Edge]

Find the first edge in the given selection object.

Parameters

selection_object (Gui.SelectionObject) – A given selection object.

Returns

The first edge found in the selection object.

Return type

Optional[Part.Edge]

find_face_in_selection_object(selection_object: FreeCADGui.SelectionObject) → Optional[Part.Face]

Find the first face in the given selection object.

Parameters

selection_object (Gui.SelectionObject) – A given selection object.

Returns

The first face found in the selection object.

Return type

Optional[Part.Face]

find_selection_object_by_type(selection_objects: List[Gui.SelectionObject], object_type: str) → Optional[FreeCADGui.SelectionObject]

Find the first selection object with the given object type.

Parameters
  • selection_objects (List['Gui.SelectionObject']) – A list of selection objects returned from Gui.Selection.getSelectionEx().

  • object_type (str) – Type as defined on a model class bound to obj.Proxy.Type.

Returns

SelectionObject or None if object with type is not found in selection.

Return type

Optional[Gui.SelectionObject]

find_vertex_in_selection_object(selection_object: FreeCADGui.SelectionObject) → Optional[Part.Vertex]

Find the first vertex in the given selection object.

Parameters

selection_object (Gui.SelectionObject) – A given selection object.

Returns

The first vertex found in the selection object.

Return type

Optional[Part.Vertex]