Hot answers tagged

10

I did not per se figure it out becuase i don't really understand what is going on here but I was trying different things until it worked. I am not sure whether it is suppose to work or whether this crudity can even be called a workaround but here it goes: Keep both "ESRI.ArcGIS.AddIns.targets" and "ESRI.ArcGIS.AddIns.11.targets" in the "C:\Program Files (...


6

Assuming your project is setup correctly, with all references added and compiles without errors. Using Visual Studio Express 2013, ArcGIS 10.3 and targeting .Net framework 3.5 Also ensure you add ArcObjects Library References to: DataSourcesGDB GeoDatabase Carto Public Sub New() On Error GoTo Trap Dim sPathFGDB As String Dim sFCName As String ...


5

You can check for the EditState on the editor extension.


5

To find the name of the dataset as stored in the database use IDataset.BrowseName. IDataset.Name will give you the layer name as it is named in ArcMap. You should also test that the layer can be cast to IDataset: If TypeOf currentLayer Is IDataset Then... Things like group layers don't implement IDataset, and will cause an error.


5

It seems you can no longer trust the ISelectionSet.AddList, according to the help document: This method should not be called by .NET or Java applications. Instead, call IGeoDatabaseBridge2.AddList. [C#] This method should not be used in .NET. Instead, use IGeoDatabaseBridge2.AddList. [Visual Basic .NET] This method should not be ...


5

You need to iterate the datasets to get his containing feature classes. Like this: While Not pSdeDSName Is Nothing Dim pEnumDataset = pSdeDSName.Subsets Dim pSubset = pEnumDataset.Next() While Not pSubset Is Nothing If pSubset.Type = ESRI.ArcGIS.Geodatabase.esriDatasetType.esriDTFeatureClass Then ListBox1.Items.Add(pSubset....


4

The affine transformation makes no sense if you have lat/lon coordinates and a map in some kind of projection. This is how a map of your region looks in UTM 36N projection: and this is IsraeliTM: You can easily see that the meridians are not parallel, and the latitudes are large circles. Affine projection only works when the grid is orthogonal. Try to ...


4

If your application is running inside of ArcGIS your product license should handle the activation of extensions for you. Failing that you can always use ArcObjects to check out the required extensions. How to use extensions (ArcObjects) Extensions provide additional functionality to applications. Before using the functionality provided in an extension, ...


4

If you comment out the Store call, you should be good: http://help.arcgis.com/en/sdk/10.0/arcobjects_net/componenthelp/index.html#//0025000007wv000000 Store should not be called inside of edit events, such as OnCreateFeature, OnChangeFeature or OnDeleteFeature. Even if you are modifying the geometry or other field values, Store will be called once the ...


4

I think you are making this more difficult than it has to be. You are obtaining your selected features from IMap.FeatureSelection. So multiple layers could return a selection. A much better way is to get a handle on your ILayer, cast that into an IFeatureLayer then point an IFeatureSelection interface to IFeatureLayer. From this you can get an ISelectionSet....


4

Yes. You need to respond to the IEditEvents.OnCreateFeature which returns an object of type IFeature which has a property Class which will give you the feature class it belongs to. After you have the feature class belonging to the new feature you can iterate through your editable layers (using IEditLayers.IsEdtiable) and see if the (ILayer as IFeatureLayer)...


4

Figured it out seconds after posting, you need to specify a colour using the Color.FromArgb method making sure you specify the desired alpha transparency then the base colour i.e. mpl.Symbolizer = New DotSpatial.Symbology.PolygonSymbolizer(Color.FromArgb(50,Color.Blue), Color.Black)


3

The best recommendation I can give is don't. Creating a TIN using ArcObjects is a tedious process. You would be best looking at IGeoprocessor and calling the existing tools. If you have 5 points in memory then write them to a new shape file and create the TIN from points.


3

Here is the C# code to get the addin assembly folder: public static string AssemblyDirectory { get { string codeBase = Assembly.GetExecutingAssembly().CodeBase; UriBuilder uri = new UriBuilder(codeBase); string path = Uri.UnescapeDataString(uri.Path); return Path....


3

This is possible in python using FeatureClasstoFeatureClass with Fieldmappings. You can also rename fields at the same time. So if you have a Featureclass with FIELD3,FIELD2,FIELD1 and you want the result to be FIELD1,F2,F3 then the following code should accomplish this. arcpy.env.overwriteOutput = True input_fpath = "c:\\gis\\Geodatabases\\temp.gdb\\...


3

I cannot prove it, but I think that the best orientation will (most of the time) be the orientation of the minimum bounding rectangle by width. You can use the built in tool "minimum bounding geometry" (RECTANGLE_BY_WIDTH), which also compute the angle. It should be faster than building all your lines if the spacing between lines is small.


3

This page states that the ExportXML coClass was removed in version 10.0 so this is why your code has stopped working. If you want your code to be as simple as your original code then by far the easiest method is to call the export geoprocessing tool using the IGeoProcessor. Otherwise you would need to obtain the propertyset and write out each element of ...


3

If you have an IPointCollection you can add points to it (IPoint), be careful which point you use as there are many types that are "point", the one you want is IPoint: IPoint pPoint = new PointClass(); // in C# Dim pPoint as IPoint = new PointClass() ' in VB.net Then add to the IPointCollection, assuming known X,Y and Z: Dim pPntColl as IPointCollection =...


3

Had a quick search on Google for what R6034 meant and here are some threads, it may not even be anything to do with ArcMap: Thread Reason StackOverflow Q&A And a whole load more...


3

If you want to select features by polygon using ArcObjects, you would typically use a spatial filter, which is very simple to implement. Here's an example in VB.NET, where pPolygon is your polygon object, and pLayer is the layer you wish to select features from: ' create the spatial filter Dim pSpatialFilter As ISpatialFilter = New SpatialFilterClass() ...


3

This line: pRow = pCur.NextRow should be at the end of your loop Do Until pRow Is Nothing SegmentID = pRow.Value(pFieldIndex1) DrainName = pRow.Value(pFieldIndex2) MsgBox("SegmentID = " + SegmentID) MsgBox("DrainName = " + DrainName) pRow = pCur.NextRow Loop I think it's failing because you're trying to retrieve a value when pRow ...


3

You get the selection set on the feature layer but then you do a feature count on the feature class, an object that does not support selections. So your current logic makes no sense. Now do you want to export an EXISTING selection or do you want to SELECT then export? If you want to export an existing selection then delete the Featurecount code as that is ...


3

What you are looking for is the circumcircle of a triangle. The circumcircle of a triangle is the circle that passes through all three vertices of the triangle and is unique. Help Although I think you are not looking for the math behind, here, you can find the math to reach to center and radius of a circumcircle from three points (a triangle). The good ...


3

You can't go from a feature to a featureLayer, because the same feature can be part of multiple featureLayers (ex: add the same layer multiple times with different symbology, filtering etc). What you can do is to go from the feature to the featureClass to the Dataset. If you want, you can then compare the dataset name with the layers dataset and at last ...


3

First when you're saying categories you're talking about two different things (unless I am misunderstanding). First you have the subtype. Second you have a domain. For the purposes of this explanation I'm going to make a couple assumptions. You only have a coded value domain (basically a dictionary) of associated values. The domains are defined by subtype (...


2

I think the error maybe your calculateField. When you join tables you get a qualified field name this is: Tablename.fieldname So in your case it will be the FeatureClass name and the field name you are calculating into and in your code I think this would be: ONT_Stations_Shape.TotalAnnua So you need to be passing in as the CalculateField parameter "...


2

I know this is totally out of the scope of the question, but could be useful for those who want to reorder fields inside a table only once by hand. You can do the trick by importing the classes (or the whole geodatabase) into a personal geodatabase. Then open it with Access and reorder the fields (yeah, cool) and export it back to the original format. Hope ...


2

This is not possible in ArcGIS as ArcGIS is not a 3D but rather a 2.5D software as discussed here: How to set up a 3D plane in ArcGIS? What is a better idea for modelling a fault plane than as TIN? You should try a specialized 3D geology & exploration software such as Geosoft Target or Leapfrog Mining.


2

The following VBA code shows you how to inverse the current selection on a layer, you would then get a SelectionSet on it to step through the new selection. Public Sub InverseSelection() ' Get Document Dim pMXdocument As IMxDocument Set pMXdocument = ThisDocument ' Get Map Dim pMap As IMap Set pMap = pMXdocument.FocusMap ' Get ...


2

I have eventually solved the issue, based on the post by Hornbydd. As he suggested, something in my PATH environment variable was causing mixed architecture (32 and 64 bit) DLLs to get loaded. 1) I downloaded and installed ESRI's 64 bit geoprocessing software for ArcGIS 10.1 Service Pack 1. I had read somewhere else that Python uses a service to call ...


Only top voted, non community-wiki answers of a minimum length are eligible