arcobjects

Using ArcObjects and .NET in Python

This question was posed on the GIS Stack Exchange, and the replies include a number of interesting approaches. Below is another one. Why not just use .NET? I have several years worth of DLLs built using VB.NET and ArcObjects. Recently I’ve been using more and more open-source libraries, the majority of which can be manipulated […]



Getting a Feature Layer by Name

An often required function is to get a specific layer from a current map document. The code below is for VB.NET and requires a map document and uses the alias name of the feature class. The first function returns all IGeoFeature layers in a map – these are layers based on vector geographic data. The […]



Hiding Geodatabase Tables

The following VBA function hides all on the geodatabase tables added by ESRI into an Access database. Useful if you spatially enable your users database, and they wonder what all those GDB_ tables are for.. To unhide just change the Trues to False in the code snippet below, or add a parameter to the sub.



Convert C# to VB.Net

It can be frustrating when a code sample that seems to do exactly what you want is written in C#, and your application is in VB.Net. http://www.kamalpatel.net/ConvertCSharp2VB.aspx solves this problem by converting the C# code directly into its VB.Net equivalent – all online and for free for code up to 6.15KB in size, and for larger amounts of code a […]



An End to Database Locks!

Writing ArcObjects code and using an Access personal geodatabase will result sooner or later in an error along the lines of “Cannot aquire a schema lock because of an existing lock.” Spending hours going through code, making sure objects are disposed of and that all connections closed often makes very little difference. It becomes apparent […]



Adding Coordinates to a Map Layout

A recent request by an ArcMap was user was how to add the current coordinates of the dataframe to the map layout in ArcMap. I messed around with grids and labelling for a while before resorting to a VBA script. The code below should copied and pasted into the VBA Editor in ArcMap, and run when […]



Another Visual Studio Macro

My start up program when working with ArcObjects is nearly always set to ArcMap.exe As my ArcMap installation had recently moved from an F: drive to a C: drive I had to update this for over a dozen projects. There had to be an easier way (!) so I spent some time trying to find out how […]