5

I am using the FocusMap.FeatureSelection to return all the currently selected features.

I want to process only the currently editable features and leave the remainder alone.

How can I quickly programmatically tell which features are editable?

I know of the IEditLayers.IsEditable method, but think that might be a little heavy handed to try and map from a feature back to the featurelayer and then test that for all selected features.

Is there another way, or is this all I have available to me?

PolyGeo
65.5k29 gold badges115 silver badges350 bronze badges
asked Jun 2, 2011 at 17:31

2 Answers 2

8

Look at the EditWorkspace from the Editor extension. Compare the pointer from that workspace to the pointer of workspace of the FeatureLayer::FeatureClass. Remember that workspaces are always accesible from the IDataset interface (supported by the featureclass). If they are the same, then that workspace is being edited.

Another option is to simply look at the workspace of the layer's featureclass and use the IWorkspaceEdit interface to figure out if the IsBeingEdited property returns true

answered Jun 2, 2011 at 17:35
1
  • 2
    Thank you. So, what I did was QI from feature.Class to IFeatureClass to IDataset. Then IDataset.Workspace to IEditWorkspace and then tested is IsBeingEdited before processing the feature. Commented Jun 2, 2011 at 18:04
1

IEditor.EditSelection will return all the currently selected features that belong to editable layers.

answered Jun 2, 2011 at 19:55
1
  • Yes but I have the feature as the result of a cursor or other process and needed to know if I could edit it or not. I guess I could compare the lists to see if it is found in EditSelection, but being as that isn't an easily searchable grouping I found the QI'ing above to work well. Commented Jul 28, 2011 at 14:02

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.