IFeatureLayer and IFeatureCursor

2261
3
05-31-2010 01:50 AM
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).
0 Kudos
3 Replies
JonathanBailey
Occasional Contributor III
Can you modify your QueryFilter to apply the NOT operator to your WhereClause?
0 Kudos
by Anonymous User
Not applicable
Original User: newbyproger

in what way? I use ISpatialFilter and collect features in FeatureCursor with geometry.
0 Kudos
JonathanBailey
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.

0 Kudos