HOW TO

Remove a generic object from ISet

Last Published: April 25, 2020

Summary

The Remove method on the ISet interface expects a single argument, an IUnknown pointer.

Procedure



This sample code removes selected objects from an ISet returned by the GetObjectsRelatedToObject method.

Code:
Dim pObjSet As ISet
Set pObjSet = pRelationshipClass.GetObjectsRelatedToObject(pOriginFeature)

pObjSet.Reset

Dim i As Integer
Dim pObject As IObject
Set pObject = pObjSet.Next

For i = 0 To pObjSet.Count - 1
If Not pObject Is Nothing Then
If pObject.Value(pObject.Fields.FindField("Point_Name")) = "Lafayette" Then

MsgBox "Before Remove: " & pObjSet.Count
Dim pUnk As IUnknown
Set pUnk = pObject
pObjSet.Remove pUnk
MsgBox "After Remove: " & pObjSet.Count
End If
Set pObject = pObjSet.Next
End If
Next i

Article ID:000004550

Software:
  • ArcMap 8 x

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options

Discover more on this topic