This document is archived and information here might be outdated.  Recommended version.


ISelectionSet Interface (ArcObjects .NET 10.8 SDK)
ArcObjects Help for .NET developers > ArcObjects Help for .NET developers > ArcObjects namespaces > Geodatabase > ESRI.ArcGIS.GeoDatabase > Interfaces > IS > ISelectionSet Interface
ArcGIS Developer Help

ISelectionSet Interface

Provides access to members that manage a set of selected table rows or features. Note: the ISelectionSet interface has been superseded by ISelectionSet2. Please consider using the more recent version.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Members

Name Description
Method Add Adds an object id to the selection set.
Method AddList Adds a list of object id's to the selection set.
Method Combine Combines this selection set with another selection set using the specified set operation.
Read-only property Count The number of oids in the selection set.
Read-only property FullName The full name of the selection set.
Read-only property IDs Enumerates the object ids in the selection set.
Method MakePermanent Makes the SelectionSet permanent. By default SelectionSets are deleted when released.
Method Refresh Refreshes the state of a snapshot selection.
Method RemoveList Removes a list of object id's from the selection set.
Method Search Returns a cursor that can be used to retrieve the objects specified by a query over this selection set.
Method Select Returns a new selection That contains the object ids selected by a query over this selection set.
Read-only property Target The Table or FeatureClass over which the selection set is defined.

Classes that implement ISelectionSet

Classes Description
RelQueryTableSelectionSet Esri RelQueryTable Selection object.
SelectionSet Esri Selection Set object.
TMSSelectSet (esriTrackingAnalyst) Controls the tracking selection set.

Remarks

A SelectionSet is used to reference a set of rows or features. This can be used to retrieve, process and select rows or features. 

A SelectionSet can be obtained from IFeatureClass::Select or ITable::Select.

If you want to obtain a selection set on a feature layer it is good practice to cast the layer to the ITable interface then use the ITable::Select method. The table that you will obtain this way will mirror the content of the layer even if it has a definition query or a join.

The IFeatureSelection interface contains a SelectionSet property which can be used to access or set the selection on a feature layer. If trying to set the selection with this property you must make sure that the content of the selection set is compatible with the features currently in the layer. It is usually simpler to use IFeatureSelection::SelectFeatures instead.

Selection sets are also used in a number of other interfaces dealing with the selection: ITableSort, IFeatureSelection, ITableSelection, ISelectFeaturesOperation, to name a few.

There are three types of selection sets: ID sets, snapshots, and hybrids. A selection set's type is determined at creation time (for example, by the selType parameter of the IFeatureClass.Select method).

Two of the methods defined by this interface should not be used in .NET or Java applications - AddList and RemoveList. See the IGeoDatabaseBridge2 interface for interop-safe alternatives.

.NET Samples

Create camera flyby from path Custom reshape polyline edit task Custom vertex editing commands Custom vertex editing commands ArcGIS Network Analyst extension barrier location editor ArcGIS Network Analyst extension Engine application Selection restriction evaluator Subset network evaluators