Tag Info

New answers tagged

1

BruTile has a lot of breaking changes from v0.7.4 to v0.12 You will have to adjust SharpMap's TileLayer to reflect these.


2

The following code fixed it for me. Change this: Message msgForm = new Message(); msgForm.lbl.Text = message; msgForm.ShowDialog(); To this: MessageBox.Show(message);


1

I don't program in C# so may be what I am going to suggest is actually valid syntax for c#? I think the problem is this line: if (mxdoc.SelectedLayer == layer) If VB .net one would not compare two layer objects this way. If this was me using VB I would have done it this way: if mxdoc.SelectLayer.Name = layer.Name then msgbox "same!" end if


0

I realize this question is old but maybe someone will benefit from my contribution. I encountered same problem while working on Add-In for ArcMap 10.0. There is documented bug for 10.0 regarding IGPToolCommandHelper2 described here. I found workaround how to open tool's dialog and avoid "Failed to open tool SomeTool (SomeToolbox.tbx)" error. Here is the ...


0

I found why. While in the old API the previous code works, here you have to add data attributes to your layers as indicate in the "Render graphics layer" example of the documentation in this page: https://developers.arcgis.com/net/desktop/guide/add-graphics-and-text.htm In order to do that Define a UniqueValueRenderer for a GraphicsLayer using code, ...


2

They also have instructions for using .NET 4.0 or 4.5 if you wish to take advantage of the new language features: .NET 4.0 and 4.5 support for ArcGIS 10.2 Desktop and Engine developers The only change you need to make is to edit ArcMap.exe.config (or the relevant .exe.config for the application you are extending) and changing: <startup> ...


3

ESRI recommends to use the Microsoft .NET Framework 3.5 Service Pack 1 for version 10 and higher: ArcObjects SDK System Requirements for 10.1 ArcObjects SDK System Requirements for 10.2 So as you can see in this post What are the correct version numbers for C#? you should learn C# 3.0.


1

So, I've solved this question myself. The requirement was to send the annotation data to an annotation feature class within a GDB. Whilst I am yet to be able to create GDB and FCs with ArcObjects, I created these manually and then created the pointer variables that accepted the annotation data. Consequently, ArcMap did not fall over and produced the desired ...


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


2

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


1

I think I have cracked it, after the delete statement I added mxDoc.UpdateContents(); which seems to have worked,


0

This arcgis desktop Addin may be helpful with your problem, Link


2

MapControl is an engine component to create your own window to display map contents. I've looked before and never found a way to get a reference to the ArcMap MapControl. ArcMap may not even use a MapControl for its display, it may use some other internal class. Two options: 1) var ave = ActiveView as IActiveViewEvents; ave.AfterDraw += onAfterDraw; ...


1

Since you say you have some experience in Python, I believe what you are trying to do could be accomplished with a Python Add-In (I'm not well versed in ArcObjects and C#). I have a jankety workaround function that I call in other scripts that will generate annotation feature classes (always for a soils data set) based on a project boundary. The way this ...



Top 50 recent answers are included