(Visual Basic for Applications) A subset of Visual Basic that provides a common language for customizing Microsoft applications.
11
votes
2answers
1k 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
4answers
915 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 ...
6
votes
1answer
4k 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
1k 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
363 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
4k 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
203 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
1k 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
654 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
695 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
2answers
848 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
340 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
117 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
1k 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
432 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
737 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 ...
3
votes
1answer
294 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
2answers
2k 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
3answers
641 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
4k 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
393 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
668 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
4answers
627 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
1answer
264 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
327 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
2answers
1k 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
1answer
430 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
215 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
474 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
1k 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
269 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
3k 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
159 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
389 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
788 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
158 views
Is there a (better) way to debug Visual Basic Code Block in calculate field using ArcGIS?
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
161 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
329 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
0answers
187 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
1answer
894 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 ...
2
votes
3answers
387 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
3answers
192 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 = ...
2
votes
3answers
1k 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?
2
votes
2answers
388 views
Create a dbf table by copying the structure of another dbf table
I have a dbf table and I wish to automatically create another dbf table with a different name but with exactly the same structure i.e.fields as the existing table. Is there any ready code in VBA and ...
2
votes
3answers
679 views
Arc Objects and non-spatial table
I am a new Arc Objects user, with little ESRI experience.
We are using VBA to create a spatial report on a Map Control using a mdb table. The mdb table contains a Lat and Long field, and this data is ...
2
votes
1answer
484 views
Disabling/overriding internal arcmap commands with vba
I am creating a template for ArcGis JTX. This is a mxd file, with a vba onload event handler which removes some functionality from vanilla ArcMap.
I'm stumped on one problem: double clicking on a ...
2
votes
1answer
1k views
Run Model ArcMap 9.3.1
I would like to Run/execute a model within ArcMap 9.3.1 vba. I can run it in vba by exporting out the VBS script and importing it into vba, however I'm wondering if there is an easier way to just call ...
2
votes
2answers
324 views
Can I use VB to search against an arcserver service in arcmap?
I've published a ArcServer service that is going to be consumed by out of the box, standard ArcGIS on the desktop. My question is, is it possible to write custom tools in VB to query layers from that ...
2
votes
1answer
2k views
convert from C# to VBA
I have a code that wrote with C#.But I need to convert it to VBA and then use from it into GIS.
how can I convert it be VBA?
2
votes
1answer
36 views
Syntax question for ArcGIS ICalculator object
This is a silly question, but I have this code snippet that I can't figure out:
'Define a calculator for NewArea field
pCalculator = New Calculator
With pCalculator
.Cursor = pCursor
...

