IFeatureLayer and IFeatureCursor

2053
3
05-31-2010 01:50 AM
Highlighted
by Anonymous User
Not applicable
Original User: newbyproger

I have some features in FeatureCursor from FutureLayer (by searching in FeatureClass). How can i get features IDs from FutureLayer which are different from features IDs in FutureCursor? (like switching selection) There are a lot of features, that is why simple double loop with comparing IDs is not suitable (it takes a lot of time).
Reply
0 Kudos
3 Replies
Highlighted
Occasional Contributor III
Can you modify your QueryFilter to apply the NOT operator to your WhereClause?
Reply
0 Kudos
Highlighted
by Anonymous User
Not applicable
Original User: newbyproger

in what way? I use ISpatialFilter and collect features in FeatureCursor with geometry.
Reply
0 Kudos
Highlighted
Occasional Contributor III
In this case, maybe try using the SelectionSet class. You could try something like this:


  1. Get a SelectionSet of the features you've selected from the FeatureLayer using the IFeatureSelection.SelectionSet property.

  2. Use the ISelectionSet.Combine method to create a new SelectionSet containing the features that are unselected. You'll need to create a new SelectionSet with your FeatureLayer's FeatureClass as the target, and another to contain the results of the combine operation. You might have to experiment with which SelectionSet to call the Combine method on to get the correct result.

  3. Apply the resulting SelectionSet to your FeatureLayer using the IFeatureSelection.SelectionSet property.

Reply
0 Kudos