POST
|
From SDK help: Note that only the top-level datasets in the workspace are returned by these methods. In particular, if a workspace contains both stand-alone feature classes and additional feature classes that are part of a feature dataset, then calling the DatasetNames property on the workspace with a dataset type of esriDTFeatureClass will return only the standalone feature classes. In order to get the feature class names within a feature dataset, the application needs to get the FeatureClassNames property on the top-level feature dataset name returned by the workspace. IWorkspace.DatasetNames Property will list all matched types for the top level only. If your feature classes are inside featuredataset you should use IFeatureDatasetName.FeatureClassNames After you get your dataset. Thanks Ahmed El Sisi
... View more
03-16-2014
05:04 PM
|
0
|
0
|
91
|
POST
|
Here are a couple options. C# / ArcObjects: IWorkspaceFactory workspaceFactory = new WorkspaceFactory(); IWorkspace workspace = workspaceFactory.OpenFromFile("[Path to an SDE connection file goes here]", 0); var namesEnum = workspace.DatasetNames[esriDatasetType.esriDTFeatureClass]; var tempName = namesEnum.Next(); while (tempName != null) { // Add string comparison logic here, e.g. tempName.Name.StartsWith("G") Console.WriteLine(tempName.Name) tempName = namesEnum.Next(); } Dear Erin Brimhall, I am getting a problem: my SDE contains some feature classes, but after using the statement: var namesEnum = workspace.DatasetNames[esriDatasetType.esriDTFeatureClass]; var tempName = namesEnum.Next(); // get value null The value of tempName is Null, but it is ok if I use esriDatasetType.esriDTFeatureDataset. Do you know why ? Thanks and regards, Tai
... View more
03-13-2014
12:38 AM
|
0
|
0
|
91
|
POST
|
Hi, I am finding a statement to show or list all names of feature classes in SDE. Do you know this ? Thanks and regards, Tai
... View more
03-02-2014
03:43 PM
|
0
|
5
|
3202
|
POST
|
Use IDataset.Delete. I would imagine you can't delete feature datasets unless they are empty though. Thanks Neil, I got the error: Layer in use SDE when trying to delete. Please see my code: IDataset pdataset; pdataset = (ESRI.ArcGIS.Geodatabase.IDataset)featureClass; if (pdataset.CanDelete() && pdataset != null) pdataset.Delete(); // Throw exception Do you know how to fix this ? Thanks and regards, Tai
... View more
02-25-2014
03:21 PM
|
0
|
0
|
94
|
POST
|
Hi everyone, Are there anyone know the statements/methods to delete a SDE feature dataset and a SDE feature class from SDE database ? (using C# or VB) Thank you very much. Tai
... View more
02-25-2014
04:57 AM
|
0
|
4
|
4400
|
POST
|
Hi everyone, I am getting a problem when try to read features from the Dgn files using ArcObjects. After I delete some elements (polygons) in Dgn file. They still exist when reading the dgn file. Do you know how to ignore the deleted features ? Please see my code: Type factoryType = Type.GetTypeFromProgID( "esriDataSourcesFile.CadWorkspaceFactory"); System.Object obj = Activator.CreateInstance(factoryType); factory = obj as IWorkspaceFactory; IFeatureWorkspace ftrWorkSpace = (IFeatureWorkspace)factory.OpenFromFile(strWorkSpace, 0); IFeatureDataset pFeatureDataset = ftrWorkSpace.OpenFeatureDataset(strFileName); IFeatureClassContainer pFeatureClassContainer = (IFeatureClassContainer)pFeatureDataset; IFeatureClass pCadPolygon; pCadPolygon = pFeatureClassContainer.get_ClassByName("polygon"); IFeatureCursor pFeatureCursor = pCadPolygon.Search(null, false); if (pFeatureCursor == null) return false; While (pFeature != null) { //..... } Thanks and regards, Tai
... View more
02-24-2014
07:21 PM
|
0
|
0
|
499
|
POST
|
Thank you, The original dgn file haven't set coordinate system yet. Then I set it (same with projection system of SDE) as your say. But, the area still not equal. So I am checking features again I attached the project file for your refecence Thanks and regards, Tai
... View more
02-19-2014
05:47 PM
|
0
|
0
|
28
|
POST
|
Thank you. I am reading features from CAD file (.dgn) then write to feature class in SDE. I haven't set the SpatialReference for the geometries of these features before checking the area. Could you tell me how to set it ? Plese see my codes: Type factoryType = Type.GetTypeFromProgID( "esriDataSourcesFile.CadWorkspaceFactory"); System.Object obj = Activator.CreateInstance(factoryType); factory = obj as IWorkspaceFactory; IFeatureWorkspace ftrWorkSpace = (IFeatureWorkspace)factory.OpenFromFile(strWorkSpace, 0); IFeatureDataset pFeatureDataset = ftrWorkSpace.OpenFeatureDataset(strFileName); IFeatureClassContainer pFeatureClassContainer = (IFeatureClassContainer)pFeatureDataset; IFeatureClass pCadPolygon; IFeatureCursor pFeatureCursor = pCadPolygon.Search(pQueryFilter, false); if (pFeatureCursor == null) return false; IFeature pFeature = pFeatureCursor.NextFeature(); while (pFeature != null) { ...... } Thanks and regards, Tai
... View more
02-19-2014
12:10 AM
|
0
|
0
|
28
|
POST
|
Thanks Sachin, Yes, it is the correct feature (polygon). But it contains many other features (polygons). So, I subtracted it the areas of sub features, but the final result doesn't equal the value: Shape.Area. How can I get the area of that feature (not include area of sub features) ? Please see my image (the current feature is green) [ATTACH=CONFIG]31541[/ATTACH] Thanks and regards, Tai
... View more
02-17-2014
09:32 PM
|
0
|
0
|
28
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|