Was this question ever fully answered, perhaps someplace else?
Here is a sample for opening a shapefile. Or did you want to get the workspace from an existing layer in the map? IWorkspace workspace; IWorkspaceFactory workspacefactory; IFeatureWorkspace featureworkspace; workspacefactory = new ShapefileWorkspaceFactory(); workspace = workspacefactory.openFromFile(filePath, 0); featureworkspace = (IFeatureWorkspace) workspace;
IWorkspace workspace; IWorkspaceFactory workspacefactory; IFeatureWorkspace featureworkspace; workspacefactory = new ShapefileWorkspaceFactory(); workspace = workspacefactory.openFromFile(filePath, 0); featureworkspace = (IFeatureWorkspace) workspace;
To help anyone else that is looking, the current workspace can be found via: IWorkspace ws = ((IDataset)ArcMap.Document.ActiveView.FocusMap.Layer[0]).Workspace;
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.