Selection commands#

NaxToView functions to control the selection in the active view.

n2vscripting.selection.clear_selection() None#

Clear current selection.

n2vscripting.selection.create_group(group_name: str) None#

Create a group with the currently selected elements.

n2vscripting.selection.get_all_elements_list()#

Get a list of all elements in the model.

n2vscripting.selection.get_list_selected_items() list[int]#

Get a list with the ids of the current selection.

Return type:

A list of ints with the ids of the currently selected items.

Examples

>>> selected_items = n2v.get_list_selected_items()
n2vscripting.selection.get_visible_elements_list()#

Get a list with the ids of all visible elements.

n2vscripting.selection.hide_free_edges() None#

Hide free edges in the model.

n2vscripting.selection.hide_selected() None#

Hide current selection. Only valid for element selection.

n2vscripting.selection.isolate_group(group_name: str) None#

Isolate elements from a group.

Parameters:

group_name (str) – Name of the desired group.

Examples

>>> n2v.isolate_group('MyGroup')
n2vscripting.selection.isolate_selected() None#

Isolate current selection. Only valid for element selection.

n2vscripting.selection.reverse_selection() None#

Reverse current selection.

n2vscripting.selection.reverse_visible() None#

Reverse visibility of the whole model.

n2vscripting.selection.select_adjacent() None#

Add adjacent elements to current selection. Only valid for element selection.

n2vscripting.selection.select_all_elements()#

Select all elements in the active view.

n2vscripting.selection.select_attached() None#

Add attached elements to current selection. Only valid for element selection.

n2vscripting.selection.select_by_face() None#

Add all elements in the same face(s) as current selection to it. Only valid for element selection.

n2vscripting.selection.select_elements(elements_list: list[int], part_id: int = 0) None#

Select elements from the current view given a list of ids.

Parameters:
  • elements_list (list[int]) – The list of elements to be selected.

  • part_id (int, optional) – ID of the part. Default is 0.

Examples

>>> n2v.select_elements([10000000, 10000001, 10000002])
>>> n2v.select_elements([10000000])
n2vscripting.selection.select_group_elements(group_name: str) None#

Add elements from a group to current selection.

Parameters:

group_name (str) – Name of the desired group.

Examples

>>> n2v.select_group_elements('MyGroup')
n2vscripting.selection.select_nodes(nodes_list: list[int]) None#

Select nodes from the current view given a list of ids.

Parameters:

nodes_list (list[int]) – The list of nodes to be selected.

Examples

>>> n2v.select_nodes([10000000, 10000001, 10000002])
>>> n2v.select_nodes([10000000])
n2vscripting.selection.select_visible_elements()#

Select all currently visible elements.

n2vscripting.selection.show_all() None#

Show the whole model.

n2vscripting.selection.show_free_edges() None#

Show free edges in the model.

n2vscripting.selection.show_selected() None#

Show current selection. Only valid for element selection.

n2vscripting.selection.toggle_item_labels() None#

Toggle id labels on the current selection.

n2vscripting.selection.unhide_adjacent() None#

Show elements adjacent to current selection. Only valid for element selection.