Is there an effecient way to find the workspace that is being edited so that we can specify if a feature is included on the edit session or not?
My story is that I need to know if any feature (randomly selected from the map) in the map can be edited or no since every feature in the map can be edited through code although it is out side the edited workspace, and also there are featurelayers of different types e.g. CAD Layers, ShapeFiles, FeatureClass (SDE & PGDB), & etc...
Dim pmap As IMap pmap = g_pMxDoc.FocusMap Dim penumlayer As IEnumLayer penumlayer = pmap.Layers Dim player As ILayer player = penumlayer.Next Dim pfeatlayer As IFeatureLayer Dim pfeatcls As IFeatureClass Dim pwrkspcedit As IWorkspaceEdit Dim pdataset As IFeatureDataset Dim plist As String Do Until player Is Nothing If (TypeOf player Is IFeatureLayer) Then pfeatlayer = player pfeatcls = pfeatlayer.FeatureClass pdataset = pfeatcls.FeatureDataset pwrkspcedit = pdataset.Workspace If pwrkspcedit.IsBeingEdited Then plist = pfeatlayer.Name & vbNewLine & plist End If End If player = penumlayer.Next Loop MsgBox(plist)
But when running the above code an error is occured: "Object variable is not set to an object" at the bold line up. Please advise,
Also a sample code on how to check if the layer belongs to the edited workspace is preferable.