# Tag Info

Accepted

### Extracting all points within a certain distance and height difference from a Raster

A perhaps-too-simple approach would be to use Focal Statistics. Define the neighborhood of interest as an annulus, with inner radius just under 720m and outer radius just over 720m. (This depends ...
• 8,926

### Opening QGIS using VBA and executing Python script?

QGIS can take a --code that you can pass a Python file to in order to run. qgis --code my myfile.py Run this command from the VBA shell command.
• 34k
Accepted

### Calculating Sinuosity Using ArcGIS Field Calculator

If done in Python: Expression parameter: getSinuosity(!shape!) Codeblock parameter: import math def getSinuosity(shape): length = shape.length d = math.sqrt((shape.firstPoint.X - shape....
• 2,364
Accepted

### Route hatch labeling as stations (0+00) with vba

You missed an underscore in the esri__measure variable in your first 2 if clauses, so they always tested as equal to 0 and fullfilled the condition of the first clause (an uninitialized variable ...
• 8,455
Accepted

### Cannot convert dms to dd in Excel 2007 using VBA code

Are the longitude and latitude values in separate fields? Because the Convert_Decimal function requires a single value. After trying this myself, I think you were trying to convert the DMS values to ...
• 18.3k
Accepted

### Can't fill the attribute table programmatically

I believe the code you have: Set pFeature.Value(3) = 2 needs to be pFeature.Value(3) = 2 The reason is that the value it is storing is a number and not an object. If you are planning to run this ...
• 39.7k
Accepted

### "CountIf" or alternative function in ArcMap field calculator?

This is generally not something that should be done using the Field Calculator (although by using a cursor you can do it, it is better to create a standalone Python script). The easiest approach is ...
• 8,455
Accepted

### Creating custom forms in ArcMap

VBA is still available in 10.x, but must be installed separately. Prior to 10.x, it was included with installation files. Now, however, you must install separately and receive a license for the VBA ...
• 5,727
Accepted

### Matching OBJECTID with value using VBA in ArcMap?

Your code won't work. You loop the cursor until it finishes. At that point pFeature is Nothing. After that you try to access the OID value of pFeature, which is Nothing. If you only select a ...
• 8,455
Accepted

### Tutorial on creating python toolboxes?

As long as a tool is simple input-output python-toolboxes are great, but creating your own gui elements is not supported, drawing line is kinda possible using featureSet, but not in a user friendly ...
• 3,463

Extending on Chad's answer, following does the trick for feature layer with multiple legend groups for (int k = 0; k <= (featureLayer as ILegendInfo).LegendGroupCount - 1; k++) { (featureLayer ...
• 86

### How to make a Python script that does a task in QGIS?

You will want to run this as a standalone application. The reference for this can be found in the appropritate pyqgis cookbook section. You need to run setup code at the beginning and cleanup code at ...
• 26.4k

### "Error in Parcel Selection" in SaeX in ArcGIS 9.3

Installing arcgis did not install visual basic properly. Manually installing VBA solved the problem.
• 8,134
Accepted

### VBA Labeling works on some symbol classes but not other

If there are any instances of special characters (& and <) in [LOCA_ID], the formatting will fail. You have to replace them dynamically with code like this: Function FindLabel ([LABELFIELD]) ...
• 5,288
Accepted

### How to get a Layer as ILayer (ArcObjects)

You need to access the active document in order to get access to layers. Create a reference to the document using your IMxApplication object (pMxApp): Dim pMxDoc as IMxDocument = pMxApp.Document ...
• 1,178

### Route hatch labeling as stations (0+00) with vba

Actually, since you know all your measures always end in +00, because that applies to all intervals of 500, you can simplify the expression to: esri__measure / 100 & "+00" You only need the more ...
• 8,455
Accepted

### Referencing a method from a different class within an Else statement and using 2 variables with the method

Thanks to Daniel from geonet, the problem has been solved. As far as referencing ValidFacet is concerned, the app needed to be changed from 'void' to 'bool'. Daniel also corrected various problems ...
• 309
Accepted

### Adding VBA code to ArcMap

I was able to find the same answer that @mkennedy wrote as a comment by using Google to search on "arcgis 10.2 vba". The first result was a page entitled Installing ArcGIS for Desktop VBA ...
• 63.9k

### Any extention Open File Dialog

This is substantially the work of Radar in an answer to a similar question, using the same ArcObjects as Hornbydd does. I have modified Radar's function for my clients to select a delimited text file ...
Accepted

### "Error in Parcel Selection" in SaeX in ArcGIS 9.3

Installation of VBA manually will solve the problem. The VBA can be manually installed from the Installed Directory which Usually is C Drive > Program Files (for 32 bit windows) and Program Files (X86)...
• 741

### ArcPy/Python method to ascertain VBA requirements in mxd

I don't believe arcpy exposes such properties. You need to be able to drill down into the VBProject and then VBComponents to check if a code module exists. It's been many years since I have mooched ...
• 39.7k

### VBA/Python If/then statements in Field Calculator for one column based on another not working

It is how you are dealing with Null values. You are treating Null as a string when it is NOTHING! How can nothing be something? But now think about what you are asking, in your case if colour is not ...
• 39.7k
Accepted

### Ordnance Survey coordinates mismatch when converting from Lat/Lon

It looks like the Excel sheet expects input lat/lon to be in OSGB36, while you are feeding it WGS84. (I just tested the numbers using pyproj, and got the same results as you). I strongly recommend ...
• 608
1 vote

### Matching OBJECTID with value using VBA in ArcMap?

I think SDE_OBJECT_ID might be data type LONG. Have you tried pFeature.OID.ToString(), or whatever the conversion method in VBA is? Not sure if it might fix the issue. Just an idea.
• 1,178
1 vote
Accepted

### Any extention Open File Dialog

You can call directly COM object dll Private Declare Function GetOpenFileName Lib "comdlg32.dll" Alias "GetOpenFileNameA" (pOpenfilename As OPENFILENAME) As Long Private Type OPENFILENAME ...
• 1,175
1 vote

### Any extention Open File Dialog

Below is the code you require: Public Sub OpenDataset() ' Open a dialog for user to select FeatureClasses Dim pEnumGXObject As IEnumGxObject Set pEnumGXObject = Nothing Dim pGxDialog ...
• 39.7k
1 vote
Accepted

### How to get the Features of FeatureCursor?

The naming convention you have used is not good, you declare pFeatureLayer, which to everyone on the planet should be an IFeatureLayer object, but you have declared it as an IFeatureSelection. ...
• 39.7k
1 vote

### How to get the geometry type FIELD value of attribute table?

@PolyGeo Thanks a lot!! In other words, every time I assigning cell's value to string variable - I have to check if the Field is the Geometry Field, correct? If the field type is Geometry then I ...
• 169
1 vote
Accepted

### How to get the geometry type FIELD value of attribute table?

If I have understood you correctly you want to store the text "Polygon" in your array? Shape is the Geometry field so the mismatch error is to be expected, you are trying to store a polygon geometry ...
• 39.7k
1 vote

### Merging features into single programmatically

You can use the ITopologicalOperator's Union method to programmatically merge two polygons together. This example (written in VB.NET) shows how that's done. Dim pFirstGeometry As IGeometry = CType(...
• 5,288

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