Programmatical selection methods recap

Eyeshot offers a list of methods that allows to programmatically select entities or their sub-items in the scene.

A brief recap of these method follows.

Geometry Selection

GetAllCrossingEntities

Given a rectangle in screen coordinates, it returns all the visible Entities that cross it even partially as an array of SelectedItem and it also retrieves an array of indexes of these Entities in the scene as an out parameter.

The actual geometry of the scene is taken into account in order to process the crossing with the given rectangle.

When Workspace.AssemblySelectionMode = assemblySelectionType.Leaf the leaf elements of the scene are retrieved; in such situation, no index is retrieved by the method.

When processing, the value of Workspace.SelectionFilterMode is ignored.

It is possible to process only the selectable Entities with the selectableOnly parameter.

 

GetAllEnclosedEntities

Given a rectangle in screen coordinates, it returns all the visible Entities that are fully contained in it as an array of SelectedItem and it also retrieves an array of indexes of these Entities in the scene as an out parameter.

The actual geometry of the scene is taken into account in order to process the enclosure in the given rectangle.

When Workspace.AssemblySelectionMode = assemblySelectionType.Leaf the leaf elements of the scene are retrieved; in such situation, no index is retrieved by the method.

When processing, the value of Workspace.SelectionFilterMode is ignored.

It is possible to process only the selectable Entities with the selectableOnly parameter.

 

GetAllEntitiesUnderMouseCursor

Given a point in screen coordinates, it returns all the indexes of the Entities in the scene under this location.

A pseudo-color image of the scene is taken into account in order to process the selection; Workspace.PickBoxSize can be used used in order to affect the area to be processed.

When Workspace.AssemblySelectionMode = assemblySelectionType.Leaf the leaf elements of the scene are retrieved; in such an instance the indexes are organized differently: the Entities in the scene are traversed depth first, for each leaf Entity the index is incremented by one (with the first Entity having a 0 index); when processing a BlockReference of the current scene (i.e. one with no parents) is done, the index is incremented by an additional 1 before stepping to the next Entity in the scene (this doesn't happen for nested BlockReferences and simple Entities). Note that different BlockReferences of the same Block will be processed separately, and their leaf Entities will generate different indexes.

When processing, the value of Workspace.SelectionFilterMode is ignored.

It is possible to process only the selectable Entities with the selectableOnly parameter.

 

GetAllItemsUnderMouseCursor

Given a point in screen coordinates, it returns an array of SelectedItem under this location.

A pseudo-color image of the scene is taken into account in order to process the selection; Workspace.PickBoxSize can be used used in order to affect the area to be processed.

When Workspace.AssemblySelectionMode = assemblySelectionType.Leaf the leaf elements of the scene are retrieved.

When processing, the value of Workspace.SelectionFilterMode is used too.

It is possible to process only the selectable Entities with the selectableOnly parameter.

 

GetAllVisibileEntities

Given a rectangle in screen coordinates, it returns all the indexes of the visible Entities in the scene that cross it even partially.

A pseudo-color image of the scene is taken into account in order to process the selection.

When processing, the value of Workspace.AssemblySelectionMode and Workspace.SelectionFilterMode are ignored.

It is possible to process only the selectable Entities with the selectableOnly parameter.

 

GetAllVisibleItems

Given a rectangle in screen coordinates, it returns all the visible Entities that cross it even partially as an array of SelectedItem.

A pseudo-color image of the scene is taken into account in order to process the selection.

When Workspace.AssemblySelectionMode = assemblySelectionType.Leaf the leaf elements of the scene are retrieved.

When processing, the value of Workspace.SelectionFilterMode is used too.

It is possible to process only the selectable Entities with the selectableOnly parameter.

It may be necessary to invoke GetAllVisibleEntities method before, in order to have the pseudo-color image ready.

 

GetCrossingEntities

Given a rectangle in screen coordinates, it returns all the visible Entities that cross it even partially as an array of SelectedItem and it also retrieves an array of indexes of these Entities in the scene as an out parameter.

The actual geometry of the scene is taken into account in order to process the crossing with the given rectangle.

When Workspace.AssemblySelectionMode = assemblySelectionType.Leaf the leaf elements of the scene are retrieved; in such situation, no index is retrieved by the method.

When processing, the value of Workspace.SelectionFilterMode is ignored.

It is possible to process only the selectable Entities with the selectableOnly parameter.

It is also possible to stop the processing when the first entity is found by using the firstOnly parameters; note that the latter works by entity, so when Workspace.AssemblySelectionMode = assemblySelectionType.Leaf all the leaf elements of the first BlockReference found are retrieved.

This behavior differs from GetAllCrossingEntities, that always processes all the entities in the scene; another difference is that it can be set a specific subset of Entities to perform the selection on.

 

Label Selection

GetAllLabelsUnderMouseCursor

Given a point in screen coordinates, it returns all the indexes of the visible Labels in the scene under this location.

Workspace.PickBoxSize can be used used in order to affect the area to be processed.

When processing, the value of Workspace.AssemblySelectionMode and Workspace.SelectionFilterMode are ignored (they have no meaning for Labels).

It is possible to process only the selectable Labels with the selectableOnly parameter.

 

GetAllVisibleLabels

Given a rectangle in screen coordinates, it returns all the indexes of the visible Labels in the scene under this location.

When processing, the value of Workspace.AssemblySelectionMode and Workspace.SelectionFilterMode are ignored (they have no meaning for Labels).

It is possible to process only the selectable Labels with the selectableOnly parameter.

 

 

Was this article helpful?
0 out of 0 found this helpful

Comments

0 comments

Please sign in to leave a comment.

Articles in this section