Hot answers tagged

24

The answer to this question is yes and no. It is possible with some effort to do everything in Python that you could do in .Net, but easy and possible are two very different things. Following that, the simplest interpretation is no, Python Add-Ins cannot do as much as .Net Add-Ins. However, the tasks Python Add-Ins can accomplish are much easier and faster ...


16

In Visual Studio 2013, to fix this check Use Managed Compatibility mode in VS2013 > Options > Debugging > General (last option in the list). Original answer by Preston McCormick here


11

I have been struggling with this for a long while too. For example the standard blue dot icon for a button does show, but all my custom icons did not. By default Visual Studio sets the build action for an image you add to the solution to 'Content'. Apparently this has to be set to 'AddInContent'. After I changed this, all my button images where visible.


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 (...


8

2 years and 2 version later and this is still a problem. Just finished updating/improving all my addins for 10.2 and came across this problem again. Implemented ALL sugestions in this post and nothing worked but I have discovered 1 additional possible problem. Unfortunately, I am not sure if this was the culprit or not because I've also implemented most ...


8

The Esri ArcGIS Add-In Installation Utility is the installer for the AddIn. A user would typically double-click the *.esriAddIn file which would call ESRIRegAddIn.exe. Alternatively, you could specify AddIn folders. Check out this blog: http://blogs.esri.com/esri/arcgis/2010/05/05/add-ins-for-arcgis-desktop-10/ I think you could still do your dependency ...


8

The add-in model is a new feature in version 10.0. This means you will not be able to use an add-in at lower versions, which require you to implement your commands, extensions, toolbars etc. in the older COM-only model.


8

ArcGIS Pro currently does not support Python add-ins. There were no plans for a Python Add-in support in ArcGIS Pro. ArcGIS Pro has arcpy site package shipped though (you can author Python script tools). Your only option is ArcGIS Pro .NET SDK which is going to be released soon (it is in beta now). UPDATE: from Esri Forum ArcGIS Pro will feature a new ....


7

Yes there is a cache on the local machine. At version 10.1 it is: C:\Users\user name\AppData\Local\ESRI\Desktop10.1\AssemblyCache In the AssemblyCache folder will be a folder for each add-in ArcMap has loaded. The folders are named with a long alpha-numeric that won't make any sense, but if you click into these folders you will see .dll, .pdb, and .xml ...


6

The key to proper parenting of WPF windows within a non-WPF application is to use the WindowInteropHelper class. Suppose you have a WpfWindow class which is a WPF window (derives from Window): private void ShowWpfWindowModal() { var parentHandle = new IntPtr(_app.hWnd); // the ArcMap window handle var wpfWindow = new WpfWindow(); //...


6

Yes there are several ways to do this. I would recommend building a script tool and packaging it with your add-in. I have a sample project that does this listed in this answer: How can I programmatically get the path of "Python.exe" used by ArcMap See also: Running ArcPy script from ArcObjects? Leveraging ArcPy in a .NET application


5

Yes, since you are presumably using VB.NET (not VB, which is 20+ years old and no longer supported), you need to use the Imports statement to import namespaces. Specifically you want to put Imports ESRI.ArcGIS.Geometry at the top of your code files. Alternatively you could fully qualify the IPoint type every time you use it (ESRI.ArcGIS.Geometry.IPoint) ...


5

As my project's .NET Framework is 4.0, I changed to supportedRuntime version="v4.0.30319" in ArcMap.exe.config and I noticed that the problem was delayed by this change. I also remembered that ArcMap also loads ArcCatalog so I changed also ArcCatalog.exe.config to supportedRuntime version="v4.0.30319" and YES!!! It's working again. I spent all day trying to ...


5

For deploying without any setup tool, double-click the *.esriAddIn file. This file could be found in the debug folder, after build the project in Visual Studia 2010. Add-ins for ArcGIS Desktop 10 For deploying a custom component using a setup tool: How to deploy a custom component using a setup project


5

If you really need as assembly to have it's own config you directly load it using this .net code. System.Configuration.ExeConfigurationFileMap fileMap = new System.Configuration.ExeConfigurationFileMap(); fileMap.ExeConfigFilename = "THE PATH TO THE CONFIG"; System.Configuration.Configuration cfg = System.Configuration.ConfigurationManager....


5

This is just conjecture, but there is probably some variable-width text measurement logic going on behind the scenes, and the character W was probably chosen because it is one of the widest characters available in variable-width fonts. I agree that it is a bit nonsensical to do it this way.


5

ArcGIS Runtime SDK and ArcGIS Addins are two different things. If you want to develop standalone application then choose ArcGIS Runtime Sdk. If you want to extend ArcGIS Desktop , then you should start developing with ArcObjects (e.g. using addins). So first install ArcGIS Desktop and then install ArcObject SDK for .NET which is accompanied with ArcGIS ...


4

I tried the suggestions above for a while, and finally got to a solution. Cutting to the chase, I'll give the solution first, then the explanation: Open Task Manager. End Process for any copy of ArcMap.exe. Open a Windows Explorer. Navigate to C:\Users\\Local Settings\ESRI\Desktop10.. If you don't see AssemblyCache, Organize > Folder and search options > ...


4

PerfQAnalyzer does just that. From that page: In the Spring of 2012 we released the PerfQAnalyzer tool, which assists users in capturing render and edit times within ArcGIS for Desktop. This tool is a free, unsupported, downloadable tool offered to the Esri user community which can be run from within ArcMap (as an add-in) or as a stand-alone ArcGIS Engine ...


4

I don't think this is possible (intercepting another tool's private data/events), but the good news is that reinventing the wheel is pretty easy when the inventor shows you how to do it. See the Custom selection extension Add-In Sample, particularly the SelectByLineTool class. You could tweak it to use a NewPolygonFeedback instead of a line feedback, and ...


4

With previous versions of ArcMap (9.x) you needed to compile for the lowest common denominator. For example a COM extension written for 9.2 would install in 9.3 as long as any newly added or depreceated ArcObjects were not used. The service pack also made a difference. An extension written for 9.2 SP4 would not install on a 9.2 SP1 machine. However the ...


4

Use microsoft's SerializableAttribute and Esri's PersistenceHelper. I haven't tested this code. Esri's help page for add-in Extension OnLoad method seems to have mangled the example code. Here it is reformatted: // Need to add reference to ESRI.ArcGIS.ADF.Local assembly. // using System; // using System.Collections.Generic; // using System.IO; // ...


4

kor_, here's what I did (in ArcMap 9.3.1). Created a separated configuration file for log4net; Loaded that when the extension code loaded; Started to log away. public class CadastralExtension:IExtension { private ILog _logger; private IApplication _application; private ICadastralApplicationEventListener _cadastralEventListener; private ...


4

First off, I have not tried using Config.esriaddinx for this purpose, but I wouldn't recommend it. It is meant for the configuration of the add-in itself, not necessarily user data, and you probably don't want to mix the two. It has been a while since I've dealt with this myself so I may be a little fuzzy on the details, but there are multiple issues with ...


4

I thought this got documented. Since it's undocumented, it's not officially supported, so your mileage may vary, not responsible for damage, etc. filter is a callable that returns a True/False value as to whether the path specified can be saved to or opened (in the case of OpenDialog). filter_label is what shows up in the filter text in the dialog below the ...


4

According to the official documentation: ArcGIS for Desktop, ArcGIS Engine, or ArcGIS for Server is required to develop with ArcObjects SDK. Microsoft .NET Framework 3.5 Service Pack 1


4

.Net 4 is supported by ArcGIS 10.1, but there is a little extra work you will need to do. http://resources.arcgis.com/en/help/arcobjects-net/conceptualhelp/index.html#//000100000nzv000000 If you require any of the .NET 4.0 Framework functionality, you can extend Esri products with components written in the .NET 4.0 Framework. However, it's your ...


4

You could cast the IFeatureClass to an IDataset. IDataset has several properties that might work to get the name of the workspace (or database). You could try IDataset.workspace, which would give you the IWorkspace interface. You could also try IDataset.FullName, which will give you an IName interface object, which could be cast to IWorkspaceName. Hope ...


4

You can get that from the Workspace ConnectionProperties: var lyr = ArcMap.Document.FocusMap.get_Layer(0); var fc = (lyr as IFeatureLayer).FeatureClass; var dict = fc.GetWorkspace().ConnectionProperties.ToDictionary(); foreach (var kvp in dict) { Trace.WriteLine(string.Format("{0}={1}", kvp.Key, kvp....


4

I had this problem in Visual Studio 2010, when you included your error message it came back to me. The answer can be found here : https://stackoverflow.com/questions/2483659/interop-type-cannot-be-embedded. Extract of: For whatever reason, this assembly can't be embedded - but it sounds like that's not a problem for you. Just open the Properties tab for ...


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