An object-oriented programming language from Microsoft. It is the .NET version of the Visual Basic (VB) programming language.
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
916 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 ...
10
votes
4answers
345 views
Does SHAPE_Length take into account elevation values?
Does the Shape_Length attribute take into account the elevation? For instance, if I have 3 points: A, B, and C
A.X = 10
A.Y = 10
A.Z = 10
B.X = 10
B.Y = 10
B.Z = 50
C.X = 0
C.Y = 0
C.Z = 10
Then I ...
7
votes
4answers
1k views
Connecting line features and determining the length of the longest line
I have a line feature (see image) representing a river that I created using the Stream_to_Feature tool. The attribute table contains several records representing different lines - the problem is the ...
6
votes
4answers
729 views
Deriving separate polylines from coded points using ArcObjects (Figure inside)
I have a single point featureclass that represents the left and right sides of a landform (the points are coded as either 'right' or 'left'). Visually I can pick out and digitize two lines along these ...
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
2answers
1k views
Remove Shapefile lock
I have an ArcObject Dissolve procedure that creates a shp in a directory. This dissolved layer is a temp layer and is not added into ArcMap. I would like to delete it when the user clicks a button ...
5
votes
1answer
136 views
Spatial Query works while stepping through debugger but not otherwise
ORIGINAL POST:
I'm not actually sure whether this is a VB.net problem or an ESRI problem...but given the number of really odd ESRI quirks I've encountered, my money's on the latter...
I have a piece ...
4
votes
4answers
927 views
Exploring ArcObjects through C# or VB from Python background
While I understand that this may be off topic to an extent, I am in a bit of a bind and could use some help directing my thought process and research.
I have little programming background aside ...
4
votes
1answer
1k views
Selecting the MAX value from a feature using ArcObjects?
I have a feature (point) with a field called 'Sequence'. The values in this column range from 1 to n. I can use IQueryFilter to get the first value, 1.
Dim pQry As IQueryFilter = ...
4
votes
2answers
161 views
Is IPolygon2.QueryExteriorRingsEx Method not working in ArcGIS version 10.1 SP1?
I am updating my addins from 10.0 to 10.1 and my code is crashing on the IPolygon2.QueryExteriorRingsEx Method.
I understand there is something strange going on with this method because Developer ...
4
votes
2answers
638 views
Problem creating a point IFeatureClass
I'm trying to create a point IFeatureClass, but my code doesn't work.
Public Function CreatePointFeatureClass(ByVal featureClassName As String, _
ByVal ...
4
votes
1answer
100 views
Turn off field programmatically in ArcMap via VB.Net
I'm creating an addin button in Arcmap via VB.net that when clicked, runs the identify tool. But I want only selected fields to appear in the identify dialog. My idea is to hide the unnecessary fields ...
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
1answer
755 views
Filtering a raster by pixel cluster size in ArcGIS?
I have a raster image representing islands in a river (see image) created using the following process:
1) Clip a water surface DEM and watershed DEM by a bounding polygon (waters' edge).
2) Subtract ...
4
votes
1answer
285 views
Refresh Currently Open ArcMap Attribute Table using ArcObjects
I have written an ArcMap Addin (ArcMap 10.0) that allows a user to perform a join between an in-memory table and a feature class (feature layer) added to the TOC. I want the attribute table of the ...
4
votes
0answers
246 views
Creating a VB.net Dataset in Visual Studio 2010 from an SDE Geodatabase
I am building an ArcMap Addin that contains several Windows Forms with controls that need to be bound to a database. I am trying to decide whether or not to use a native SQL Server Database or an SDE ...
3
votes
3answers
272 views
Enable Add-In Button if One Feature is Selected from Specific Layer
I am trying to enable an add-in button on my toolbar if only one feature is selected from a specifc Layer. For example, when ArMap loads, the button should be disabled. If the user selects one feature ...
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
695 views
ArcObjects VB.Net - Editing in Geodatabase
Greetings,
I have a script in VB.Net for grabbing values from one feature and assigning them to another. It works fine on shapefiles, but upon importing the same shapefiles into a file geodatabase, I ...
3
votes
2answers
86 views
How do I change the targeted .NET 4.0 Framework to version 3.5 in an existing VS 2010 EXPRESS project?
I am upgrading from ArcGIS desktop 10.0 to 10.1 and I have a bunch of addins developed in VS 2008 Express using ArcObjects 10.0. I would like to upgrade everything to 10.1 using VS 2010 Express. I ...
3
votes
4answers
2k views
Sum the values of a single raster and output the value as a number?
I have a floating point raster and have applied a conditional to it in order to only extract the positive values, so there are 'no data' "holes" in the raster. I simply need to sum the values from ...
3
votes
1answer
170 views
How to programmatically clear all layers from data frame?
I'm trying to create a button using VB.NET and ArcGIS 10 to clear the layers of my data frame.
I know how to add layers, but I don't have any idea on how to delete/clear them.
Any suggestions?
...
3
votes
2answers
475 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
1answer
147 views
Counting distinct values in a field of a table stored in pgdb
I need to calculate total count of distinct values of a field . That field contains many duplicate values also. The table which contains that field is stored in pgdb.
I want things done in vb .net. ...
3
votes
1answer
70 views
How to use IDatabaseCompact.Compact() on an used IWorkspace, without permission denied
I am writting an ArcMap-AddIn with vb.net. I get an error when trying to compact my IWorkspace(mdb), the error is:
COMException
You tried to open a database, which was already opened by the ...
3
votes
1answer
277 views
ArcGIS 10 Addin - Code Doesn't Execute on Another Computer
I've created an ArcGIS 10 Addin that consists of a toolbar containing one button and one tool. The button opens a form, and the tool is disabled until the user enters some information on the form.
...
3
votes
1answer
237 views
ArcObjects 9.2 SDK: How to intersect two SelectionSets (in-memory pointers) and return a FeatureClass?
[Update]
Since posting this question, I've come to the conclusion I'm not fighting flaws in the BasicGeoprocessor object, but more likely having issues with poor object lifecycle management on my ...
3
votes
1answer
365 views
Unable to create temporary GeoDatasets in g_g_g folders
I am converting a VBA macro that was written for ArcGIS 9.3 to a VB.NET project using the ArcGIS 10.0 .NET SDK. I am getting the following error whenever the code tries to create a temporary ...
3
votes
1answer
182 views
Repairing disconnected layers with selection sets
Has anyone had any success of repairing disconnected layers that have selection sets that have their data sources broken in ArcGIS? Is there a way to detect this through code and then re-create that ...
2
votes
1answer
215 views
Why do I get an “Type 'IPoint' is not defined” error in VB.NET
I am writing an add-in for ArcMap 10. I am trying to do Dim clickedPoint as IPoint in VB.NET, but I get "Type 'IPoint' is not defined" error. Do I have to import a class or how do I make this work?
2
votes
5answers
1k views
Programmatically calculating the length of all polyline features in a featureclass
I've come across this issue a few times and have not yet found an agreed upon solution on any forum.
Simply put, I have a featureclass containing many polyline features. I would like to calculate the ...
2
votes
2answers
686 views
ArcObjects: Getting the properties of a layer that has lost its data source (VB.NET)
When you save an ArcGIS map document (MXD) and then change the data source of a layer in the MXD, you can no longer see the layer in the MXD and you must redefine its data source.
But suppose you ...
2
votes
1answer
867 views
ArcMap Geoprocessing vba code/tool - smooth polygon
I would like to execute the smoothpolygon tool within ArcMap vba and I'm having some trouble defining the parameters syntax for the tool. I'm getting this error below:
ERROR 000622: Failed to execute ...
2
votes
3answers
399 views
Connecting to non geodatabase MS Access database using ArcObjects
I am trying to connect to an MS Access database from a program I have written in VB.Net with ArcObjects 10.0. My MS Access database is not a personal geodatabase so apparently I have to connect to ...
2
votes
1answer
229 views
How to use nested loops with cursors?
I use the following nested loops to read the first point feature of a dataset and the rest points in that dataset. Then read the second point feature of a dataset and the rest points in that dataset ...
2
votes
1answer
266 views
How to cast SDE table to IFeatureClassLoad
How do you cast an SDE table to IFeatureClassLoad using ArcObjects? I'm getting an error with this attempt below which is not the correct method:
Dim pSDEFeatWksp As IFeatureWorkspace = ...
2
votes
1answer
604 views
Create data table in geodatabase
Using vb.net, my custom tool needs to create a data table in my geodatabase to store some information for later use. The user will be in ArcMap 9.3.1 with the geodatabase up and layers displayed. I ...
2
votes
1answer
67 views
The field cannot be deleted because it is being used as a relationship key.
I want to delete some fields of featureclasses, but when I run the code FeatureClass.DeleteField(Field) it works well for some featureclasses but after some time it gives an error such as:
The ...
2
votes
2answers
364 views
DLL As Embedded Resource ArcMap Add-In? VB.NET
I tried using StackOverflow, but I don't think anyone can answer my question in context(ArcMap Addins).
I am currently developing an add-in that needs to load a custom control DLL as a dependency. ...
2
votes
1answer
427 views
arcgis server 10, .net web api samples
i am running arcgis server 10, installed visual web developer express 2010 edition, now wanted to run samples from arcgis.com for .net web api, for example the following one
...
2
votes
1answer
2k views
VBA to VB.NET (Visual Studio 10) Migration - ArcMap Focus
I will be migrating several VBA applications currently in ArcMap 9.3.1 to Visual Studio 10 in the near future, and wanted some feedback on the general migration steps listed below. I wanted to make ...
2
votes
1answer
37 views
How can I suspend default shortcut menu and substitute with a custom menu in the TOC?
I looking for solution (using ArcObject SDK 10.1 (VB.NET) ArcMap Addin template) to substitute the default shortcut "right-click" menu in the TOC (When a TOC Item is right-clicked) with a custom menu ...
2
votes
1answer
280 views
How do I save an ArcMap map document using VB.Net?
I am trying to save the map document that is currently open. How do I write the code? I have tried many suggestions that I found using Google searches, but nothing works. Currently I have:
Dim ...
2
votes
1answer
276 views
ArcMap 10 Layout View: search for elements and delete
I've to regenerate a single layout with data from each point feature. So, I wrote a VB.NET routine to clean the layout, searching for text element, selecting it and deleting it.
Well, the routine ...
2
votes
1answer
293 views
find path where add-ins are installed
I see that my add-ins are installed to
C:\Users\Me\AppData\Local\ESRI\Desktop10.0\AssemblyCache{6C90269B-D233-4122-3747-C2AE1131E22C}
Is it possible to find that file path from within the Add-in ...
2
votes
1answer
255 views
arcgis server 10, vb.net add reference problems
i am using 'arcgis server 10' and 'visual web developer 2010 express'. now, i opened a 'web mapping application' then wanted to 'add a reference' to 'esri arcmap object library 10.0' it says:
A ...
2
votes
1answer
406 views
Adding an ILayer to IMap in Arcgis Server 10
I wanted to add ILayer to IMap, i think it has been added but problem is that it does not display it on the website.
I am running arcgis server 10, using visual web developer 2010 express edition ...
2
votes
1answer
481 views
ArcMap Commands .NET code equivalent
What is the .NET code equivalent for this general ArcMap command syntax:
Application.Document.CommandBars.Find(ArcID.Query_ClearSelection).Execute()
I have been using this one below as a work ...
2
votes
3answers
516 views
CreateFeatureClass failure in vb.net
I'm using ArcGIS 9.3.1 and trying to get the code to create a new feature class in an existing personal geodabase to work but I am having no luck. When running in debug mode from within vb.net it will ...