ArcObjects Library Reference  (System)    

ISet Interface

Provides access to members that control a simple set of objects.

Product Availability

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

Description

The ISet interface provides properties and methods for adding objects, removing objects, and sequentially accessing objects in a Set.

When To Use

The Set object holds a collection of homogeneous or heterogeneous objects.

Members

Description
Method Add Adds an object to the set.
Read-only property Count The element count of the set.
Method Find Searches for the object in the set.
Method Next Returns the next object in the set.
Method Remove Removes the object from the set.
Method RemoveAll Removes all objects from the set.
Method Reset Resets the set for enumerating through the objects with Next.

CoClasses that implement ISet

CoClasses and Classes Description
GroupFeedback (esriDisplay) Feedback for a group of feedback objects.
ObjectList (esriTrackingAnalyst) ObjectList Class.
Set Generic set of objects.
[Visual Basic 6.0]

When declaring a variable for the Set object, using the variable name pSet or pset will raise a Visual Basic compile error. When instantiating the Set object, use New esriSystem.Set instead of New Set.  The word Set is a reserved word in Visual Basic.

The code below adds the selected features in an edit session to a Set. They could then be moved together with a call to IFeatureEdit::MoveSet.

Dim pMySet As esriSystem.ISet
Set pMySet = New esriSystem.Set
Dim pEnumFeature As IEnumFeature
Set pEnumFeature = pEditor.EditSelection
pEnumFeature.Reset
For Count = 0 To pEditor.SelectionCount - 1
  Set pFeature = pEnumFeature.Next
  pMySet.Add pFeature
Next Count

 


Feedback Send feedback on this page