POST
|
Hi, Implement IToolControl and ICommand interfaces. http://edndoc.esri.com/arcobjects/9.2/componenthelp/esriSystemUI/IToolControl.htm
... View more
09-14-2010
09:38 AM
|
0
|
0
|
15
|
POST
|
Hi, If you a pass point, you can use CONTAINS method to check whether the point is COMPLETELY inside the polygon but return false if the point is on the boundary line or outside the polygon. IPointCollection4 pc4 = MyPoly as IPointCollection4; for (int i = 0; i < pc4.PointCount; i++) { IPoint thisPoint = pc4.get_Point(i); bool isPointInPolygon = pointRelationalOperator.Within(thisPoint); //tried both Within and Contains isPointInPolygon = pointRelationalOperator.Contains(thisPoint); } In th above piece of code, you are checking whether the polygon vertices are present inside the polygon. But the vertices fall on the boundary line of the polygon and hence CONTAINS method always returns false. http://edndoc.esri.com/arcobjects/9.1/componenthelp/esrigeometry/IRelationalOperator_Contains.htm
... View more
09-11-2010
01:08 AM
|
0
|
0
|
12
|
POST
|
Hi, You can convert KM to DecimalDegrees and pass the values to the PutCoords method as shown below. IUnitConverter unitConvertorObj = new UnitConverter(); double kmInDecimalDegrees = unitConvertorObj.ConvertUnits(10, esriUnits.esriKilometers, esriUnits.esriDecimalDegrees); //This gives u the 10KM equivalent in DecimalDegrees. pEnvelope.PutCoords(pCenter.X - kmInDecimalDegrees , pCenter.Y - kmInDecimalDegrees , pCenter.X + kmInDecimalDegrees , pCenter.Y + kmInDecimalDegrees ); Beware that above statement seems to create and envelope of 20km x 20km. If u want to create 10km x 10km envelope then pass 5 in ConvertUnits method. http://edndoc.esri.com/arcobjects/9.0/ComponentHelp/esriSystem/IUnitConverter.htm
... View more
08-31-2010
12:46 AM
|
0
|
0
|
3
|
POST
|
Hi, Use the following to get the feature count. Pass null to get count of all features in the feature class. http://help.arcgis.com/en/sdk/10.0/arcobjects_net/componenthelp/index.html#/FeatureCount_Method/0025000002t2000000/ Use the following following interfaces for status bar http://help.arcgis.com/en/sdk/10.0/arcobjects_net/componenthelp/index.html#/IStatusBar_Interface/0042000001q3000000/ and http://help.arcgis.com/en/sdk/10.0/arcobjects_net/componenthelp/index.html#/IStepProgressor_Interface/0042000001qs000000/
... View more
08-28-2010
02:04 PM
|
0
|
0
|
2
|
POST
|
Hi David, Here is the example in C# http://resources.esri.com/help/9.3/ArcGISEngine/arcobjects/esriGeoDatabase/ITableSort_Example.htm
... View more
08-04-2010
12:26 PM
|
0
|
0
|
15
|
POST
|
Hi, You can make use of DatasetNames property on IWorkspace to get the all the Stand alone feature classes. In order to get feature classes inside the Feature Datasets, make use of DatasetNames property on IWorkspace to get feature datasets and then FeatureClassNames property on IFeatureDatasetName interface. http://edndoc.esri.com/arcobjects/9.2/ComponentHelp/esrigeodatabase/IWorkspace_DatasetNames.htm Cheers, Thaviti
... View more
08-04-2010
08:16 AM
|
0
|
0
|
0
|
POST
|
Hi Query interface IDatasetName to IName and use Open() method on IName that givies you IDataset object. public IDataset GetDataset(string targetDatasetName) { if (DatasetNames.Count <= 0) GetDatasetNames(); IDatasetName datasetName = DatasetNames.Find(IsDatasetName(targetDatasetName)); IName as nameObj = datasetName as IName; IDataset dataset = nameObj.Open() as IDataset; if (dataset == null) throw new DatasetHandlerException(GeodatabaseMessages.DatasetCouldNotBeFound); return dataset; }
... View more
08-02-2010
09:00 AM
|
0
|
0
|
0
|
POST
|
Hi, If you are using VS 2008, you get the reference of running ArcMap application. The way of getting its reference changes from case to case. E.g. If you are using ICommand interface, then 'hook' variable on 'OnCreate' method gives you the application's reference. Let me know your situation. Cheers Thaviti
... View more
07-19-2010
06:11 AM
|
0
|
0
|
1
|
POST
|
Hi, I havent encounted the same error but it might be due to the availability of the Assemblies to the developer. If you are using VBA in ArcMap (Via Tools-->Macros-->Visual Basic Editor), the following code works for me. Dim pMxDoc As IMxDocument Dim pMap As IMap Dim pFeatSel As IFeatureSelection Dim pqf As IQueryFilter Set pMxDoc = Application.Document Set pMap = pMxDoc.FocusMap Set pFeatSel = pMap.Layer(0) ' set up query filter with where clause Set pqf = New QueryFilter pqf.WhereClause = "shape_length > 200000" ' perform selection pFeatSel.SelectFeatures pqf, esriSelectionResultNew, False pFeatSel.SelectionChanged pMxDoc.ActiveView.PartialRefresh esriViewGeography, Nothing, Nothing If the above code still throws same error, try replacing the statements as shown below. Application.Document - esriArcMap.Application.Document esriSelectionResultNew - esriCarto.esriSelectionResultEnum.esriSelectionResultNew esriViewGeography - esricarto.esriViewDrawPhase.esriViewGeography ( use esriViewGeoSelection instead of esriViewGeography or use both together) Cheers Thaviti
... View more
07-18-2010
08:32 AM
|
0
|
0
|
1
|
POST
|
Hi, In order to select features, cast IFeatureLayer to IFeatureSelection interface and use SelectFeatures method on IFeatureSelection interface. To zoom to the selection, either u can use the procedure u have described in the post or run the in-built 'Zoom To Selected Features' command programatically using ICommandItem interface. Cheers, Thaviti
... View more
07-17-2010
05:57 AM
|
0
|
0
|
1
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|