(Visual Basic for Applications) A subset of Visual Basic that provides a common language for customizing Microsoft applications.

learn more… | top users | synonyms

15
votes
5answers
2k views

How can I find the farthest point from a set of existing points?

I have a set of points as a shapefile and I want to find (the coordinates) of a new point which will have the longest possible distance from each of the existing points. Is that possible? If yes, is ...
13
votes
2answers
3k views

How can I create weighted Thiessen polygons?

I have a point shape file and I create Thiessen (Voronoi) polygons programmatically using this scripting syntax: CreateThiessenPolygons_analysis (in_features, out_feature_class, fields_to_copy) ...
10
votes
1answer
187 views

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

I have a raster containing tens of millions of points all with X, Y and Z data defined. I need to figure out a simple way to extract and create a new raster or vector with ALL points at a 720 m ...
7
votes
5answers
12k views

Snapping points to lines in ArcGIS Desktop and automate using VBA?

I use ArcGIS Desktop and I want create a network with a point feature and a line feature. I need my point features to be on the line features so I should do Snap point to line. However, I do not ...
6
votes
1answer
8k views

Install VBA on ArcGIS 10

What is the complete recipe for installing VBA for ArcGIS 10 Desktop? The Esri help topic on this is incomplete. From the number of threads I found troubleshooting this I'm not the only one ...
6
votes
2answers
2k views

Finding Nearest Feature Methods VB ArcObjects

Greetings, I have: (a) point feature class (b) polyline feature class I am trying to loop through the (a) point feature class to find the nearest feature from the (b) polyline feature class. Just ...
6
votes
2answers
468 views

How can I add a new field in a raster attribute table and loop through it?

I am working with an existing raster attribute table. I wonder how can I add a new field to it and then loop through the existing records to populate this new field? Of course I have done this many ...
5
votes
1answer
5k views

ArcMap field calculator VBA question

I am trying to use ArcMap's Field Calculator to populate values in a column based on a value in another column. So, in pseudo-code: if [field1] = 'Foo' set [field2] = 'Bar' endif Something like ...
5
votes
2answers
357 views

Why esriSpatialRelTouches relation does not work?

I have two feature layers. The first one is just a polygon and the other one consists of a series of polygons which are enclosed by the first one. Thus, some polygons of the second feature layer touch ...
5
votes
1answer
2k views

How to save a layer file with a relative path

In VBA, how do you save a layer file (.lyr) with a relative path? I have some code that loads a shapefile into ArcMap but I am unsure of how I go about using this shapefile to then save a layer file ...
5
votes
1answer
843 views

How to create adjacency matrix of topology graph of arc map for shortest path?

I have created a topology graph of a polygon feature and I want to find the individual FIDS of the lines of the polygon. I want to construct an adjacency matrix to create the shortest path. How can I ...
4
votes
1answer
884 views

FIELD CALCULATOR VB scripting

In my attribute tables field. I am trying to get rid of the "&" in between names i.e. "John Adams & wife" and want it to say "John Adams and Wife" in all the attributes with "&". What is ...
4
votes
3answers
375 views

Where to find books or course materials to help prepare for Esri Technical Certification in ArcGIS Desktop and Developer?

Where I can find books or course materials to help prepare for Esri Technical Certification in ArcGIS Desktop and Developer?
4
votes
2answers
956 views

VB ArcGIS 9.3 Field Calculator

I'm trying to join one column into another. one is "acct id" and the other is "taxid number". Acct is from one county whereas the tax is from another, so there are blanks in the number of ...
4
votes
1answer
2k views

How can I import layer symbology from another layer programmaticaly with ArcObjects & VBA?

I would like to be able to develop a procedure that runs through all layers in the TOC and if the layer (name) exists in a specific folder where I am storing layer files with complex symbology I would ...
4
votes
1answer
485 views

Can you edit an SDE table via ArcObjects when not added to ArcMap

I have a table that is in SDE, what I want to do is in my userform click on the "Save" button, and the table will be edited even though it is not within the map document. Is this possible? I have ...
4
votes
3answers
152 views

How do you navigate the ArcObjects OMDS?

How does everyone get round navigating the different OMD's I can work with single interfaces no problem, but when i have to use multiple interfaces I struggle to get my head round go through different ...
4
votes
1answer
629 views

Visual Basic editor command icon is always disabled

I recently installed ArcGIS 9.3 in a PC with Windows 7.0. I opened an existing mxd file within which I developed some toolbars for a project. Each icon of a toolbar has behind it a VBA and ArcObjects ...
4
votes
3answers
1k views

Add button to open URL in ArcMap 10

I want to be able to add a button into ArcGIS for my users, something like this: http://gis.utah.gov/code-visual-basic/vba-link-from-arcmap-to-google-maps Only, using VBA in ArcMap 10 now seems to ...
4
votes
1answer
267 views

Debugging Visual Basic Code Block in calculate field using ArcGIS Desktop?

From time to time, I have to use Visual Basic in Calculate Field. As the code get bigger, the more complicated is to debug it. And ArcGIS (9.3) does not help as the error messages are, in the best ...
3
votes
1answer
418 views

How can I get the coordinates of a grid cell?

How can I get the real coordinates (i.e. X and Y) of a given grid cell when I know its row and column position? Thanks Demetris
3
votes
3answers
4k views

Polyline length calculation in ArcGIS 10/VB script

I used to run this length calc on my data in ArcGIS 8 and 9, and now it don't work in ArcGIS10. Can you tell me what I have done wrong? Dim dbllength as double Dim pcurve as icurve Set Pcurve = ...
3
votes
1answer
2k views

How to count and record the number of entities with the same name in the field calculator?

I have a question with ArcGIS 9.2. In an attribute table the column [name] includes the name of every place in this layer. Next to that (in columns [numbers]) there should be recorded how often a ...
3
votes
3answers
977 views

VB/Python script to populate a field with maximum value among other fields

I am using ArcGIS 10. I have a little experience with python but i feel that python in ArcGIS is slightly different. VB will work fine as well. Problem: I have n different columns called 'percent_1', ...
3
votes
2answers
5k views

ArcObjects (vba) update selected feature/record

I would like to edit a selected feature/record via ArcMap vba, but I'm not having much luck with this code sample (see code below). I'm not getting an error, but the record selected is not updating. ...
3
votes
2answers
587 views

Adding VBA into a Python script generated by ModelBuilder

I have created a model that does a calculate field and have used VBA in the code block. But when I export it to Python, it doesn't work. Here is the VBA code: new_value = ...
3
votes
1answer
926 views

How can I execute my custom model's tools in VB.Net?

I want to execute one of my tools (which I created with Model Builder). I can execute a built-in tool by this code, but when I change the tool name with Model Tool Names it doesn't work. I gathered ...
3
votes
2answers
2k views

How to Open a Table, Convert it to ShapeFile & projecting the data using the X and Y

it's my first project using ArcObject, i create this interface : http://i118.photobucket.com/albums/o104/b_sara/Cap2-1.png i did programme the button "Parcourir" ( browse ) using a commonDialog, it ...
3
votes
4answers
761 views

VBA script for Incremental labeling in Field Calculator?

I have a shape file with a bunch of pipes in it. I would like to be able to label each pipe with "Pipe - X". X being the number in the row that the pipe falls on (Pipe - 1, Pipe - 2, Pipe - 3, etc). ...
3
votes
3answers
830 views

get layer names from a group within a group

Trying to get the layer names from a group that are inside a group. I have the code the gets the layer from a group, but not group inside group. any ideas? Dim pDoc As IMxDocument Set pDoc = ...
3
votes
1answer
427 views

Need help translating small code block from VBA to Python

I need help from someone to translate a small piece of code from VBA to Python, due to the fact that the company I am working for has upgraded from ArcGIS 9.3.1 to 10.0 and VBA is no longer supported. ...
3
votes
2answers
502 views

Zoom to Polygon in Arcmap from Access

I am attempting to Zoom from an Access record to a specific polygon in ArcMAP but I can't seem to get the function to work. The field in Access is identical to the field in arcmap. I.E. they both ...
3
votes
1answer
497 views

ArcObjects VBA: Setting Spatial Reference for Geometry Bag

Greetings, Within the ESRI SDK resources there is an example of combining polygons by use of a geometry bag. The following code appears: 'Define the spatial reference of the bag before adding ...
3
votes
2answers
435 views

Display Access query in ArcMap

Hi I have an access database and have some built in queries in the database. The same data is stored in geodatabase with the spatial information. Now I want to follow this process: Access->push out ...
3
votes
2answers
681 views

MS Access and geocoding in ArcGIS

We are a small non-profit. We use a fairly complex MS Access application to track everything. We would very much like to geocode addresses in our application and display the results on a map. In ...
3
votes
2answers
689 views

How to loop through an array of point features?

I have a set of point features and I wish to find the points that have common coordinates. Now I changed the code as shwon bewlo by using the IPoint and the compare method through a function. I have 2 ...
3
votes
3answers
2k views

How to select the vertices from a polygon?

I am writing some VBA code to extract vertices from a polygon. I would like to ask, how to select the vertices from a polygon ? Regards Gary
3
votes
2answers
293 views

Getting line FID from polygon ITopologyGraph

I want to export polygon Arc list to txt file for that I created topologygraph for personal geodatabase feature class (polygon) using ITopologyGraph::build. I got polygon FIDs but I am not getting ...
3
votes
2answers
4k views

use VBA in a code to edit the attributes table

so i have a point shapefile. I made a button that finds the best fit line for selected points and calculates the azimuth of it (Zero degrees being the east) is there a way i can add something to the ...
3
votes
1answer
345 views

Saving VBA customization to a Normal.mxt problem

I have experienced problems with saving VBA customization to a Normal.mxt document within ArcGIS 10. I have a set of VBA macros developed originally within 9.3 version of ArcGIS that reside in a ...
3
votes
2answers
534 views

Count the number of segments of a polygon based on the angles

I wish to count the number of segments of a polygon that has a length less than 25 meters when the angle between two vertices is not close to 180 degrees i.e. if the angle is between 178 to 182 ...
3
votes
2answers
881 views

How can I load VBA customizations stored in a “document-level custom template” into a Map Document created from a “Normal.mxt” template in ArcGIS 10?

I have all kinds of custom tools that are called from UI Controls stored in a document-level map document (my custom template). In earlier versions of ArcGIS these were stored in the global-level ...
3
votes
1answer
203 views

getsubcurve from multipart polyline ArcGIS

I have code which analyzes multipart polylines (roads) from the beginning towards the end. The algorithm "moves along" the road. My multipart polylines include circular junctions and branches so they ...
3
votes
2answers
415 views

how to convert personal geodatabase feature class to coverage using arcobjects

how to convert personal geodatabase fatureclass to coverage using arcobjects with vba pls provide me any documentation or samples.
3
votes
2answers
798 views

Add-in; Failure to get code to execute when toolbar button pressed

I had written several VBA routines for ArcGIS up through v9.3 and have since upgraded to 10. Since VBA will be a thing of the past in the next version, I downloaded and installed VB Express 2008 and ...
3
votes
0answers
363 views

VBA Convert decimal degree to Meters button

I have 2 data frames one which has WGS data in it and the other OSGB1936. I am trying to create a button where the user can input decimal degrees (WGS) and it will zoom them to that location in ...
2
votes
3answers
151 views

Software needed to recreate VBA forms using python for Arc 10.0

I'm new to programming and need to convert VBA scripted tools for the 10.1 upgrade. I need to recreate the forms and use Python scripting. How do I do this? I need the form to function in 10 ...
2
votes
3answers
615 views

How do I zoom to the overall extent of two (or more) selected features from two layers?

I am creating an application where the user picks a value from a combo box, the application then selects that feature and then selects the corresponding features from a second layer, (both selections ...
2
votes
2answers
5k views

How to call a DLL file from VBA?

I have a DLL file that I have loaded and registered it in ArcGIS as a command icon. This icon launches a window where the user should do the following selections: an input file, a field name, select ...
2
votes
3answers
3k views

Find polygon centroid with Python

I'm using ArcGIS 9.3 to find centroid of some polygon features. I'd like to do this in Python, but so far I can only find solutions with VBA. Can anyone provide some leads here?