Questions tagged [vb]
Visual Basic (VB) is a programming language created by Microsoft
52 questions
0
votes
1
answer
125
views
Could not load file or assembly ArcGIS.Desktop.Core.XmlSerializers
I've upgraded ArcGIS Pro from 3.2 to 3.3. To adjust the AddIn I develop, I've upgraded it from .NET 6 to 8, and I made all necessary updates. Now, while running it, before ArcGIS Pro opens, I get the ...
1
vote
0
answers
472
views
Moving GPS Points with a VB script - Bearing works well but distance is wrong
I am using a script I found online created in 2003 by one of the commentators here. It is a great script and exactly what I have been looking for and I'm very glad to have found it. It simply takes ...
13
votes
4
answers
32k
views
How to convert Distance, Azimuth, Dip to XYZ?
I have an excel spreadsheet with header and survey drill data. Header data contains hole ID, and location coordinates, and the survey data contains related downhole survey with Distance, Azimuth and ...
1
vote
1
answer
835
views
Converting Code from VB to Python in Map Algebra
I have a problem with Map Algebra in ArcMap 10 to convert some codes made by VB, so I need to convert it to python to work in ArcMap 10 without problem.
How do I deal with map algebra in ArcMap 10?
...
0
votes
0
answers
66
views
ArcMap Field Calculator Expression for Highest Value + 1
I'm looking for a VB or Python field calculator expression in ArcMap that will calculate the Highest Value + 1 into the same field named Corr_ID. I was thinking something as simple as this max(!...
1
vote
0
answers
1k
views
Converting VB Script into Python
I have some old VB scripts which an I am wanting to turn them into Python.
My old VB code reads
If [LAND_TYPE]="RESVE" Then val = [LAND_NAME]
elseIf [LAND_NAME] = "UCL" Then val = [...
0
votes
1
answer
228
views
How to pass a variable in VB codeblock in ArcPy to calculate a field?
How do I pass a variable name - as the variable, not its name as a string - in a VB codeblock when calculating a field in ArcPy?
I am using field calculator in a tool I built with Model Builder to ...
0
votes
1
answer
77
views
How to package an image with an Addin so it can be added to page layout?
This post shows the code I'm using to insert an image into the page layout. It works fine, but it's using a hard coded path.
Adding picture to ArcMap PageLayout using ArcObjects in .NET?
Currently my ...
0
votes
1
answer
203
views
ArcPy script doesn't work for TRIM function
I have this code:
import arcpy
import os
def massiveTrim (vrb):
y=r"shape path"
for i in y:
campos = arcpy.ListFields(vrb, "", "String" )
for camp in campos:
...
1
vote
1
answer
276
views
Using VBscript restrict layer editing in ArcPad
I am attempting to restrict editing on certain layers based on the user log in.
Dim objLyr1
Dim objLyr2
Dim objLyr3
Set objLyr1 = Map.Layers("PatchPanel")
Set objLyr2 = Map.Layers("wHydrant")
Set ...
0
votes
1
answer
147
views
ArcMap calculate field based on conditional statements for other fields
I have a large dataset of species occurrence records. One field, (call it "Status_Full") contains a string of abbreviations of each designated statutory status for each record. Another field (call it "...
4
votes
1
answer
1k
views
ArcGIS Operation Dashboard
I am working on ArcGIS operation Dashboard. There is an widget on the top left corner “ Model Manager”. Here the Model manager will read the data from ForecastStage_MPT and ForecastTimePT database ...
3
votes
1
answer
494
views
Python time condition within Calculate Field
I am attempting to assign 0/1 values to each row with a point feature class based upon a time dependent condition with ArcMap Model Builder 10.2.2.
The points are categorized based upon a series ID ...
0
votes
0
answers
154
views
Calculating Field based on Domain Description of Another Field
I am trying to get the description from a field to write to another field.
However, When I calculate the new field it gives me the code and not the description. I tried using VB, but I can't seem to ...
1
vote
1
answer
457
views
Finding Points where two polylines cross in ArcGIS Runtime .NET SDK?
I am using ArcGIS SDK for .NET and have a graphic overlay defined on my mapview. I added two circles to the map (made with polylines) which overlap. I now need to determine the points at which the ...
2
votes
2
answers
423
views
Can I use VB to search against an ArcServer service in ArcMap?
I've published an ArcServer service that is going to be consumed by out of the box, standard ArcGIS on the desktop.
Is it possible to write custom tools in VB to query layers from that service in ...
-2
votes
1
answer
232
views
Converting VB to Python for Labeling in ArcGIS Desktop?
I am using ArcGIS Desktop 10.2.1.
I am really new to Python and do not understand VB. I need to convert this VB script to Python.
The code is below. It believe it is looking for a numerical value ...
0
votes
1
answer
139
views
How to get the column header of attribute table
I have a simple vb.net code which gets all the layer names present in the ArcMap and displays it in a vb form combobox. My question is if I select a layer name that is present in my combobox it should ...
1
vote
0
answers
176
views
WGS84 to OSGB, using VB script
I have adapted someone else's VB code to convert lat long to OSGB for UK locations. In essence my code converts a Google API location returned from a text search, into Eastings and Northings that can ...
5
votes
1
answer
265
views
ArcObjects Convert GxDialog to Workspace
ArcGIS 10.1 with VB2010
I am using the GxDialog to get the users option to save a feature class. The target can be a shapefile, geodatabase, or Dataset inside a geodatabase.
I can’t wrap my head ...
-3
votes
1
answer
68
views
Using field calculation with vb? [closed]
Could you please help with the code below.
dim n
if [Flow] <200 then
n = -(16.6*Log (30/10.112))*Log ( [Flow] /200)))^2)) else
elseif [Flow] > 4000 then
n = 42.2+10*(LOG [Flow]) +(33*(LOG( [...
3
votes
1
answer
136
views
Combine string and OBJECT ID using VB
I am trying to update the FACILITYID field with a String "SWW" and then follow the "SWW" with the OBJECTID field.
So I will end up with SSW1", "SSW2" all the way to the end in the FACILITYID field.
...
2
votes
2
answers
231
views
Truncating table values using ModelBuilder?
I currently have this table with the "ACT_DATE" field displaying a long string of numbers and characters. I only need the first 4 digits, for the year, and everything else I am attempting to discard. ...
1
vote
0
answers
123
views
What is port used by GPS sensor that comes in tablet? [closed]
Wanted to see: what is the port used by the GPS sensor that comes in a tablet?
or I can get the GPS?
In a tablet with Windows 8.1
What I want is to get by vb code, the coordinates of my location, ...
2
votes
2
answers
3k
views
Need a Python field calculation that works like the DatePart( ) VB Function
I have a field called Abandoned Year (short integer data type) that I am trying to populate with a four digit year from a column called Decommission Date (Date data type). I have done this in the ...
1
vote
1
answer
464
views
Use field names in combobox [closed]
I am currently stuck on a problem surrounding ArcGIS Explorer and comboboxes
What I am trying to do is use 3 comboboxes to do the following:
View all features contained within ArcExplorer's table of ...
1
vote
1
answer
247
views
VB Script can't run in Field Calculator
I wrote a simple script in VB. But it failed to run in field calculator. I can't figure out what is wrong with it. Below is a screenshot.
1
vote
2
answers
285
views
Using Calculate Field to fix hyperlinks in ArcPy gives Cannot use VB for services?
Getting an error while trying to script it, specifically "Cannot use VB for services." Snippet and VB code block as follows:
Raw block (works within ArcMap): "\ftp\raw\YYYYMMDD\Files\Charles" +[NAME]...
1
vote
1
answer
698
views
Transforming layout page units to map units using ArcObjects?
I am trying to build an add-in that will create a polygon from the current map extent. This is not a problem in Data View where I can easily get the envelope of an iMxDocument:iActiveView in data view....
1
vote
1
answer
71
views
exporting 10.2 .esriaddin to 10.0
I have successfully exported .esriaddin I created in 10.2 Arcobjects SDK to 10.0. The installation succeeded but the problem I am having is that whenever I use the command me.Close() to close the form ...
3
votes
3
answers
900
views
Verifying that ArcInfo Workstation is Installed? [closed]
What is the best way to verify that a machine has ArcInfo Workstation installed? A code sample in VBA, VB or C# would be great!
3
votes
1
answer
1k
views
Executing ArcMap AddIn function when there is mouse click on map?
I am developing an add-in for ArcMap 10.0 where I need to execute code when there is a click on the map open. How do I do this? I am using VB in Visual Studio 2010. I also need to get the coordinates ...
0
votes
1
answer
600
views
Activate / Deactivate customized ITool from Form in ArcObjects?
I'm using ArcGIS 9.3/VB6, and I have a little issue with the activation of a custom Tool:
I have a Class, that implements both ICommand and ITool
When I click on ICommand, the form is launched
First,...
0
votes
1
answer
306
views
Split by attributes with 2 fields
I am using SplitLayerByAttributes toolbox. It’s a very useful tool for me to process certain activities. As you know, I can split the feature class as per 1 field. What if I want to split the features ...
1
vote
0
answers
810
views
ArcObjects Style of a symbol chosen with the ISymbolSelector interface
I am trying to store the properties of a SimpleMarkerSymbol symbol selected by the user using the ISymbolSelector interface.
I plan to store the size, colour and style number in a file.
I can get ...
1
vote
0
answers
258
views
ArcPad 10 - VBScript Error 800A0046 [closed]
A colleague asked me to install ArcPad 10 on his Trimble JUNO 3B. He runs an application with scripts that produce messages when the GPS is turned off. The script works fine on his Trimble Nomad - ...
1
vote
1
answer
1k
views
Extracting all field names of a featureclass using query filter programmatically
I want to get all field names present in a feature class using queryfilter programmatically.
4
votes
1
answer
829
views
Exporting Featureclass to Shapefile with field names changed using ArcObjects?
I have some annotation feature classes stored in a Pgdb.I want to export them to a shape file.Some field name need too be changed in that shape file.I am using vb .net to do this.Any help is ...
0
votes
1
answer
478
views
Extending ArcGIS Desktop using Python vs Visual Basic vs Java? [closed]
I have to extend the features of ArcGIS. I've been asked to create a model written in Python that can run out of ArcGIS 10.
This model will have a simple user interface where the user can drag/drop ...
2
votes
1
answer
908
views
For Each loop over an Array in MapBasic?
.NET C# developer here. Trying to figure out MapBasic with the IDE for the first time. It's shall we say...a different experience to C# in Visual studio.
I have a ButtonPad with a button that calls ...
0
votes
1
answer
150
views
add vb6 tool to arcmap 9.2 (on windows 7 64bit machine)
I have a vb6 project which develop a tool for use in arcmap several years ago. And I managed to add the tool in arcmap 9.2 (windows xp) by:
In arcmap -> Customize -> Add from file -> choose the dll ...
1
vote
2
answers
1k
views
Convert code VB to Python
I need to convert this code to be used by python in ArcGIS
if [Field_1] < [Field_2] :
pd = [Field_1]
else:
pd = [Field_2]
-1
votes
1
answer
413
views
Rewriting VB codeblock as Python for ArcGIS Field Calculator?
I am looking for assistance to rewrite my VB codeblock into Python.
Im on Win7, Arc10.2 and Python 2.7
The code below works fine for me, I am simply looking to port it to Python so i can progress down ...
1
vote
3
answers
828
views
Replacing Variable in VB-Expression-File (.cal) of ArcGIS Desktop?
I'm trying to modify a VB-Expression saved in a cal-file by ArcGIS Desktop 9.3:
dim out
if [D19830701]=-9999 then
out= [D19830501]
else
out= [D19830701]
end if
...
1
vote
1
answer
247
views
Auto filling a form in arcpad
I am looking to figure out how to auto-fill a custom form at the click of a button. Basically i have a toolbar where if I click the button and a point on the map a form pops up and gives me a bunch of ...
6
votes
2
answers
3k
views
How to delete last part of a string starting from the 1st non numeric character? [closed]
I'm looking for a Python or VB statement to remove the last part of a string, starting where the 1st non Numeric character appears, using the Field Calculator in ArcMap 10. Here's an example of what I'...
4
votes
1
answer
2k
views
How to write labels with varying significant figures/decimal places?
I have results that range from ex. 113,009 down to 0.00495 - Can someone recommend a way to write/construct a label expression for the following in ArcMap:
• If less than 1, use 2 decimal places (...
2
votes
0
answers
391
views
How to replace accented strings in attribute tables using Python or VBA ArcGIS 10.2 [duplicate]
I need to replace accented words, into the Field Calculator, to the same non-accented ones.
For example: María ---> Maria
Need some help with this VB Code:
Dim data as integer
Dim contador
Dim ...
2
votes
0
answers
284
views
how to buffer a raster cell using Visual Basic ArcObjects in ArcMap [closed]
I am new in visual basic, I have a question about creating a buffer zone based on a raster layer.
I have a raster layer named "Value_Raster", I have a textbox in the userform, I also create a tool ...
1
vote
1
answer
693
views
exporting a featureclass to shapefile with selected fields only [duplicate]
Possible Duplicate:
How to control which Fields are exported in ArcObjects? (via Field Mapping)
I want to export a featureclass to a shapefile.The only condition i want to impose is that ...