Hot answers tagged

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


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

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


8

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


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

In order to debug ArcMap 10.3 Add-in with VS2013 in .Net 4.5. I had to attach VS2013 to ArcMap.exe process. This is kinda annoying but it is the only way I got it to work for now. I'm still confused on why this is happening. How to attach process Start ArcMap In VS2013, go to menu "DEBUG" -> "Attach to Process" Select "ArcMap.exe" and click on "Attach" ...


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

In config.esriaddinx, set the tool's onDemand property to false. Similarly, if you have any extensions that need to be initialized at startup, set its autoLoad property to true.


4

Thanks to prompting by thehealingprocess, I did investigate a little more and the GP messages indicate the proper error is actually "Workspace or data source is read only"...which a bunch of others have encountered here as a bug at 10.1: http://forums.arcgis.com/threads/80394-Error-“Workspace-or-data-source-is-read-only.”-from-file-geodatabases. Now to see ...


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


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

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

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

Not sure if this is the current source code, but it does look like a lot of buttons are tied to an edit session and if the extension enabled. Also go to Menu Customization-->Extensions and see if there is an entry for your extension that is unchecked.


4

According to this link you can indeed do that in the registry. http://resources.arcgis.com/en/help/arcobjects-net/conceptualhelp/index.html#/Advanced_add_in_concepts/0001000004n7000000/ According to the screenshot on the bottom of that page, and at version 10.0, you'd go to: Computer\HKEY_LOCAL_MACHINE\SOFTWARE\ESRI\Desktop10.0\Settings\AddInFolders


4

The way I have done this in the past is to put the code to close the window in the close document event. So you need to set up a document event handler to catch the close document event: Private m_CloseDocument Private Sub DocumentEventsHandler(ByVal doc As IMxDocument) If doc is Nothing Then Return End If Dim documentEvents = TryCast(...


4

I'm not sure what you want to do exactly, but it looks like you want to receive an event when a layer is added to, or deleted from the map, right? Here's a sample: private IActiveViewEvents_Event _avEvents; private void SetupEventHandler() { var mxDoc = (IMxDocument)ArcMap.Application.Document; _avEvents = (IActiveViewEvents_Event)mxDoc.FocusMap; ...


4

After I manually added a new button, I circled back to the SDK AddIn Component Wizard Issue and figured out how to resolve. Before posting this question, I did attempt to change the targets in the csproj file (they were incorrect) but that did not correct the issue. But that ended up being the issue. After updating the targets in the csproj and ...


4

Addins are not backwards compatible and cannot be installed on an earlier version of ArcMap. You'll have to set up a development machine or VM with ArcGIS 10.0 and Visual Studio 2010 to compile the addin then it can be distributed to PCs running later versions of ArcGIS.


4

To quote this thread, Visual Studio 2015 "will install correctly, and create projects, but will not allow you to build a project without having VS2013 installed as well."


4

If I have understood you are developing on a 10.3 machine and manually (?) editing the configuration file to say it's a 10.2 addin, is this correct? If you are developing for a 10.2 environment you need to be using. Net 3.5 not 4. Also you should be developing on a machine that has 10.2 installed and visual studio 2010. Upgrading to the latest version of ...


4

If something in ArcMap should be working and isn't there are a couple cuprits that crop up regularly. First check out %AppData%\Roaming\ESRI\Desktop10.X\ArcMap\Templates\Normal.mxt. Back that file up and delete it. If that doesn't help sometimes when installing an ArcMap add-in it won't overwrite an old install correctly. From what you've described I'd say ...


3

One of the disadvantages of developing Add-Ins in .NET is that each new version of ArcGIS uses a different incompatible version of ArcObjects and a different incompatible version of Visual Studio. The binaries generated by the .NET Add-Ins generally ARE compatible with later versions of ArcGIS, but only if you don't want to make any changes to your Add-In ...


3

According to the product engineer at Esri responsible for the Find Dialog, there is no way to customize the context menu on the result items of the "Features" tab: The Find dialog was refactored many releases ago so it could be reused in ArcReader, Engine, ArcMap, ArcScene and ArcGlobe. As a result the context menu for find features results doesn’t ...


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

There are a few possiblities. One would be the addin was not installed correctly. Mostly likely the issue is that some tools are only available in certain situations. For example, you must be in an edit session, must have a certain type of data loaded, or must have a feature selected. Based on the menu name in the image you posted, it looks like in your ...


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

If you are using System.Timers.Timer or System.Threading.Timer, your code that is triggered by the timer occurs on a worker thread. This thread will not be marked STAThread and so can't use the SaveFileDialog. You could either use System.Windows.Forms.Timer, which is synchronous and on the main UI thread, or use Control.Invoke to run your code on the main ...


3

Instead of using a Timer (which runs on a separate thread) how about using the inbuilt events: IActiveViewEvents.ViewRefreshed (start refresh) and then IActiveViewEvents.AfterDraw (finished refresh). If you listen for the AfterDraw with the drawphase esriViewDrawPhase.esriViewForeground or esriViewDrawPhase.esriViewAll (you might need to experiment a bit to ...


3

Yes, sort of. The problem here is you're accessing directly from the database which may or may not be aware of any edits; edit reside in a different database in your TEMP directory (Scratch Workspace) and don't make it to the real database until you save your edits (commit). You really should be searching from the table object derived from the map thusly: ...


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