remove feature from current selection

1140
1
04-28-2011 05:11 AM
MichaelBreitfeld
New Contributor
Hi,
is it possible to remove/unselect features from current selection programmatically? Why?

At the end, I have only one / the last feature in my selection!

Here is my Code example C#:

IMap pMap = axMapControl1.Map;
int SelObjects = pMap.SelectionCount;
IEnumFeature pEnumfeat;
IFeature pFeature;
pEnumfeat = pMap.FeatureSelection as IEnumFeature;
pFeature = pEnumfeat.Next();

for (int i = 1; i < SelObjects; i++)
            {
                //?????? remove feature from current selection
                pFeature = pEnumfeat.Next();
            }

Thank you!
0 Kudos
1 Reply
ChaoWang
Esri Contributor
Have you tried ISelectionSet.RemoveList Method? Please note that if you are developing.NET or Java applications, call IGeoDatabaseBridge2.RemoveList instead.

ISelectionSet.RemoveList() in C#
http://forums.esri.com/thread.asp?c=93&f=993&t=184072
ISelectionSet Interface
http://help.arcgis.com/en/sdk/10.0/arcobjects_net/componenthelp/index.html#/ISelectionSet_Interface/...
ISelectionSet.RemoveList Method
http://help.arcgis.com/en/sdk/10.0/arcobjects_net/componenthelp/index.html#/RemoveList_Method/002500...
IGeoDatabaseBridge2.RemoveList Method
http://help.arcgis.com/en/sdk/10.0/arcobjects_net/componenthelp/index.html#//00250000039m000000
0 Kudos