New answers tagged

1

This model assumes the world is spherical, but earth's radius changes with the latitude. If the distance covers about 1/10 of a degree, and Earth's radius ranges from 6353-6384km, then the error can be over 400m. This might cause 10km to come out as 9km if you are aggressively rounding.


0

I suspect the error is related to how you set your input features. Have a look at How to use multiple inputs, it gives examples in c# and vb.


1

It sounds like you need to refresh the TOC, you can do this through the IMXDocument interface using UpdateContents() method.


0

You can also get the ArcGIS version by querying the version of AfCore.dll. This requires knowing the ArcGIS install directory, which you can either get by querying the registry or by hardcoding (it's C:\Program Files (x86)\ArcGIS\Desktop10.3\ for most users). /// <summary> /// Find the version of the currently installed ArcGIS Desktop /// </summary&...


0

I was looking at the control, trying to figure out how to hook into it's event stream, somehow, and not having any luck. What I was missing was that the ArcGIS 10.4 Engine MapControl has an OnMapReplaced event that fires when the map is changed, for whatever reason. Catching this is trivial.


0

The best way to deal with this seems to be by following the advice Microsoft gives about how to compare two doubles: https://msdn.microsoft.com/en-us/library/ya2zha7s(v=vs.110).aspx Here's how I ended up implementing it in my code for ArcMap: If I want to select a line based on its SHAPE.len value I would set the "where clause" of the query to be: "ABS(...


0

I found a post with essentially the same question here No answer is given but the comment section provides good insight and possible workrounds. This problem is related to "False Precision" and "failure to bracket floating-point comparisons". I decided to use the rounding of value pairs workaround. I also posted a question on the ESRI Forums here where ...


0

It think this is the simplest way to add each value in a loop, rather than binding the DataGridView to a list. Your screenshot looks like you already have a column defined, if that's the case, ignore the first line: myDataGridView.Columns.Add("Wellname", "Wellname"); while (pfeat != null) { fields = pfeat.Fields; int x = fields.FindField("NAME OF ...


0

You should be able to set the Datasource for your DataGridView to your list. I would refresh afterwards, though I don't know if that's necessary or not: myDataGridView.DataSource = list; myDataGridView.Refresh();


0

Try manually registering the dll. The double quotes are needed because of spaces in the paths. The following is a single command. "C:\Program Files (x86)\Common Files\ArcGIS\bin\ESRIRegAsm.exe" /P:desktop "C:\Program Files (x86)\BMP Siting Tool\ESRI.ArcGIS.DataSourcesGDB.dll"


0

For my case, I am calling the DrawArrowedLine() method twice - once from A to B, and another time from B to A, so I can simply set an Offset value. cartoLineSym.Offset = 5;


1

To go along with my comment. The problem you have is having to figure out a way to implement interprocess communication. Whenever you start up a python script, you're creating another process to run (python.exe) to go along with your already running process (ArcMap.exe). The problem here is that there needs to be a way to communicate back and forth. You ...


0

I think the problem is your output. If you look at the help for this tool the syntax section clearly states the output is a FEATURECLASS. You are providing a string which is the browse name + "MRB", so if your dataset you are buffering was called city then the output name is cityMRB. As you can see from my example your string does not say where to create ...


0

geonet.esri.com/thread/40373 has the working code here.


1

It doesn't seem that this is supported directly in the ArcObjects API. As a workaround using the save to v9.3 route could be slow, but how slow and does it actually matter? For example let's guess it added 10sec per export. That could be annoying yes, but I'd argue that being able to use dynamic text in your mxd would save you more than 10sec in the making ...


3

I've used Richie Carmichael's code from his blog post. In a later post he said he fixed some memory leaks and uploaded to arcscripts, however that link is broken. I'll look for the code - I think I downloaded it years ago. Anyway, here is the code from his first post. Take a look at the azimuth outputs. The code uses the "projection engine" dll. I've ...


2

Below is some VBA code that shows you how to open the Item Description window from the first layer in the TOC. Public Sub OpenItemDescription() ' Get Application Dim pApp As IApplication Set pApp = Application ' Get Map document Dim pMXD As IMxDocument Set pMXD = ThisDocument ' Get Map Dim pmap As IMap Set pmap = pMXD....


1

One problem I see (which could just be how the code was copied into the question) is the const pPath quoted string is not properly formed (needs quotes front and back.) Likely that was just a typo, and not the real source of the problem... However, the loadComboBoxOn() appears to build an image array out of a list of layer names...but I don't see where ...


0

I have not familiar with this process but from reviewing a help page entitled ESRI ArcGIS Add-In Installation Utility that says things like: if the add-in specifies its target as 10.0 and An add-in targeting 10.1 and Add-ins can target only one version of ArcGIS. Add-ins targeting 10.0, for example, will not show up in any other version. ...


0

File Geodatabase is Esri's own database format, there is an API that will allow you to access data without ArcObjects but I doubt that would shed much light on your quandary. The use of indices is automatic, at the database level, and can't be detected or affirmed except for the timeliness of functions using them. I agree with blah238 the only way to ...


1

I had a fix posted on the ESRI forum by Jeff Matson which I'll put here. Basically I shouldn't be creating a new LabelEngineLayerProperties object. I can get it by querying the AnnotateLayerPropertiesCollection. There should be no need to clear and re-add it Here is the working code: public void add_halo(IGeoFeatureLayer fl) { fl....


0

The first requirement to speed up the search code is to make sure that the feature class has an attribute index on any fields that are searched by the Query Filter or Definition Query. Anytime you use a LIKE statement with wildcards at both the beginning and the end of a string it will be slow. My queries only use wildcards at the end of the string, which ...


0

This was answered on the ESRI forum but I thought I'd repeat it here. It is an issue with the Joined table. Regardless of defining the field with the layer or table name the symbology fails to find the field. As soon as the joins are removed (and if the focus field is in the rendered layer) then the rendering happens correctly. So to get around this I now ...


2

As per @MichaelMiles-Stimson comment, the arrow size has to be set before it is cast to mapSurround. pArrow.Size = 125 Dim mapSurround As IMapSurround mapSurround = pArrow ' QI The other problem was in the 7th last line in my code above. I was setting mapFrame.Background = backGround, it should be mapSurroundFrame.Background = backGround .... ...


0

I got it working by using IPointCollection to get points from the point feature class , and then casting pointcollection into IPolyline. protected override void OnClick() { IMxDocument pMxDocument = ArcMap.Document; IMap pMap = pMxDocument.FocusMap; ILayer player = pMap.get_Layer(0); IFeatureLayer pFeatureLayer = (...


2

You need to commit the changes you have made to the dataset, currently your code is not doing that. All you need to do is call the store method. So place after the last update and before the End If the following line: pfeature.store


0

Have a look at the interface IFieldInfo3 it has a property called ReadOnly, you can get to this object via the ITableFields interface. As I understand the object model you are getting the FieldInfo object from say a FeatureLayer and not a FeatureClass. So turning ReadOnly to True is changing how the field is presented when as a layer object and not the ...


0

The way to move text elements around the page layout is to use ITransform2D. Below is some VBA showing how to do it: Public Sub TextElementExample() ' Get map document Dim pMxDoc As IMxDocument Set pMxDoc = ThisDocument ' Get Pagelayout Dim pPageLayout As IPageLayout Set pPageLayout = pMxDoc.PageLayout ' Get Graphics container ...


2

You need to move int hdc = exporter.StartExporting(); to AFTER you have set up the frame to be exported. int hdc = exporter.StartExporting(); actView.Output(hdc, (int)exporter.Resolution, ref rectangle, null, null); exporter.FinishExporting();


3

While the SDK is required to create new projects (the templates that appear when you choose File>New Project), it should be possible to compile existing projects without the ArcObjects SDK. Also, I've heard: 1) you don't really need Visual Studio to compile - you can use MSBuild, which is now part of the .NET framework installation. 2) you can compile ...


1

You definitely need the ArcObjects SDK to build addins. It's more than just referencing the libraries, the SDK installs vital templates for creating addins; when you start a new project there is an Esri category which you pick from ArcMap, ArcCatalog etc.. and the template is created with all the necessary components. You might be able to get away with ...



Top 50 recent answers are included