Tag Info

Hot answers tagged

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.


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

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


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


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


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


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


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


1

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



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