Questions tagged [vbscript]

VBScript (Visual Basic Scripting Edition) is an Active Scripting language developed by Microsoft that is modeled on Visual Basic.

Filter by
Sorted by
Tagged with
1 vote
3 answers
42 views

Script field calculation Python parser

I am trying to use the field calculator to create an alphanumeric sequence, I tried to write a statement but I don't know what is wrong. So my sequence would be in a field called "Field_number&...
Jmerryline's user avatar
1 vote
1 answer
120 views

VBScript Label Expression ArcGIS Pro

Not sure what I am doing wrong. The expression is valid, but the results are that nothing labels at all. This is the function: Function FindLabel ( [Address], [Building], [Unit] ) If (IsNull[Unit]) ...
Joe's user avatar
  • 11
0 votes
0 answers
84 views

Different Labels if Field Contains Specific Text (VBScript)

I have a NAME field for multiple assets: Tanks, Reservoirs, Pump Stations, etc. Currently, I have everything labeled using the following script: [NAME] & vbNewLine & [Vol_Mgal] + " " ...
CatchE's user avatar
  • 1
0 votes
1 answer
55 views

Using Field Calculator in ArcMap

Using the field calculator of ArcMap, I know I need to use a text qualifier "" for string, and if numbers are in a text field (at least for VB Script which is what we are learning in). Is ...
uLky's user avatar
  • 1
1 vote
1 answer
1k views

Forcing label text into one line using ArcGIS Pro

I've encountered this problem where my labels are split between two or three lines, making them quite tall instead of wide. Is there a way to force them into one line? For instance, I have: 9. ...
Quercu's user avatar
  • 13
2 votes
0 answers
150 views

Combining labels for multiple points in ArcMap

I have a data set that has stacked points. I need to display the labels as one. I've seen this solution Can labels for overlapping points be combined/merged into one label? but it only works for a ...
Ryan's user avatar
  • 21
0 votes
1 answer
40 views

Getting start 3 word (string) from field using ArcMap [closed]

I would like to know can I write vbscript to class field from start 3 words for example If start AAA = "Apple" else start BBBB = "Boat" else start CCC = "Cat"
Panittha Sununwiriyakun's user avatar
1 vote
1 answer
349 views

Simple If Then VB Script for ArcGIS Field Calculator

I have a very simple If Then statement for the ArcGIS Field Calculator that is not working and I have no idea why. Could someone tell me where I went wrong? ... Dim x as Integer IF [QMD9] > 20 THEN ...
Todd's user avatar
  • 45
0 votes
1 answer
805 views

What VBScript can I use to populate a field with text using the ArcGIS field calculator?

I need to populate one field in the attribute table of a File Geodatabase with text. Every entry in the field is set to a Null value and text entry isn't conditional upon any other factor. Every entry ...
Tye's user avatar
  • 103
0 votes
1 answer
104 views

Importing an image from hyperlink to my table of contents (layer) in ArcMap

I have been trying to find a way to make it possible to import a file from my computer to the table of contents via a hyper link. For example: We have organized a grid, so when I identify I get ...
Geoarc's user avatar
  • 1
0 votes
1 answer
209 views

ArcGIS Field Calculater DateAdd() gives Expected end of statement error

I need to add seconds in an numeric column(TS_sec) to a datetime column(TS) in ArcGIS field calculator. I am using Vbscript. But i am getting following error: ERROR 999999: Error executing function. ...
YellowFace's user avatar
0 votes
1 answer
247 views

Calculating median in grouped data using ArcMap [closed]

I got stuck when calculating the median age in grouped data (age ranges) for each feature (each feature is a single administrative unit). I have about 18,000 features. Field names indicate age ranges:...
ImHappy94's user avatar
0 votes
1 answer
316 views

VBscript to change label only for certain values

I want labels displayed for two fields: [ID_Messpkt] and [Pb_corr], both numeric type I want to change the label for certain values of one of the fields: [Pb_corr] I have two scipt that work ...
Calder's user avatar
  • 35
3 votes
2 answers
184 views

Conditionally labeling layer based on three fields

I am labeling our power line span layer based on the conductor/wire type. This information is located across three fields in the span layer which represent phases A,B,C. Basically I want code that ...
hmain's user avatar
  • 43
0 votes
0 answers
50 views

Debugging VB script in ArcGIS Field Calcultor?

I work in ArcMap and I would like to use Field Calcultor (VB script) but my script is not working. The message is: there was a failure during processing check the geoprocessing results window for ...
Nirevezs's user avatar
0 votes
1 answer
60 views

Adding two to every value of field using ArcMap Field Calculator

I am working on a road network and each section is assigned a certain value and increases by 1 each section until it gets to around 500 which is the end. A change I had to make was adding two ...
richie's user avatar
  • 9
0 votes
0 answers
83 views

Select By Attribute: If-Then VB Statement

I am attempting to write an If-Then Statement where if all the UtilityBillingMerge101719.() are true then return all of the results that are true that have an account number. This currently works, ...
cheff_'s user avatar
  • 139
2 votes
1 answer
293 views

Using field calculator to populate one column using other data in same table in ArcMap

I'm not the best with using the field calculator of ArcMap and I'm unsure of what's wrong with my VBScript Basically the new column needs to contain data pulled from the same row in the following ...
richie's user avatar
  • 21
6 votes
1 answer
175 views

Stationing Callouts using VBScript Labeling in ArcMap?

I have a shapefile that I'm trying to produce a specific label for using VBScript. I'm using the values in the [MEASURE] field. "PI: " & INT([MEASURE]/100) & "+" & (ROUND(([MEASURE] - INT(...
GIS_GOD's user avatar
  • 389
0 votes
1 answer
100 views

Windows Embedded Handheld 6.5 Professional - How to Uninstall VBScript Runtime Library and Install again?

I've been having trouble getting the Trimble Positions for ArcPad Extension to correctly install on my Trimble Geo 7X handheld. I saw that another user asked about something similar and the solution ...
Zachary M Hayes's user avatar
1 vote
1 answer
39 views

Including rotated label alongside stacked label in ArcMap?

I am trying to replicate the label that I have attached an image of. Is this possible in ArcMap? So far I have stacked 3 labels but am unsure how to: Create 3 individual boxes around the stacked ...
Oli2wd's user avatar
  • 23
0 votes
1 answer
48 views

Basing an 'ELSIF' expression on several fields

I am still fairly new to coding so please excuse what may be simple mistakes. I am working in ArcMap 10.5 and have an Overhead Conductor feature layer that I need to label based on what field (...
AdLukas's user avatar
  • 81
1 vote
1 answer
137 views

Using "Elseif" "OR" "And" statement to create label from two fields

I'm an admittedly novice when it comes to scripting but I have been able to create a basic 'else if' with 'OR' expression to create a label for a fuse feature class I have constructed. I am now trying ...
AdLukas's user avatar
  • 81
1 vote
1 answer
157 views

Modifying text with tags in If Then Else in VBScript Label Expressions

I am having a problem with formatting text in a label expression using VBscript. Here is my label expression: Function FindLabel ([Mean], [Count]) if ([Mean] < 1) then FindLabel = [Count] &...
Jason Smith's user avatar
0 votes
2 answers
64 views

Inputting formatted concatenate in field of attribute using ArcGIS Desktop?

I am new to working in ArcGIS Desktop. I have feature point data with 3 fields in table attribute (objectID, shape and sequence). I want to add another field lets say called "name_sequence).. in ...
Rudini's user avatar
  • 57
-2 votes
1 answer
168 views

What's wrong with this VBscript in field calculator - ArcGIS?

The code fails when run What I try to do is to fill a field "CLASSNAME"(created text field) according to field "Value"'s value. If the value in "Value"(raster's by default field) is 1, then in "...
Alvaro Morales's user avatar
1 vote
1 answer
387 views

Using VBScript for advanced labeling in ArcMap?

I am trying to do some advanced labeling with VBScript and need some help getting to the finish line. I have never scripted anything prior to last week so I am definitely a newbie when it comes to ...
Jack Wishneski's user avatar
1 vote
0 answers
192 views

Replacing more than one escape character when labeling in ArcMap using VBscript?

I have written a label expression to match font color to the symbology for a point file based on unique values. Problem is, occasionally the comments will include one or the other special characters ("...
intermediate GIS'er's user avatar
0 votes
1 answer
3k views

If/Then Statement with LIKE using the Field Calculator

I cannot get the below to work with a LIKE variable within the If/Then statement. Is there something that I am missing? Prelogic Script dim y If [Categories] LIKE '%Orange%' Then y = "Medium" Else ...
John D's user avatar
  • 53
1 vote
2 answers
2k views

Using field calculator if statement to update another field using another field's values?

Using VBA in field calculator I am trying to figure out the expression that if 3 conditions are met populate a field using another field's value and I cant get it to work! CALC_CLASS is a joined table ...
Pat the forest's user avatar
0 votes
0 answers
87 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 ...
Smithw1's user avatar
  • 335
1 vote
1 answer
9k views

How do I add a space in a label with vbscript?

I am labeling point features in Acrmap 10.3. I have the points labeled with three fields from the attributes on the same line, but there is no space between them. what is the expression to add a ...
Malcolm G's user avatar
1 vote
0 answers
258 views

Hyperlink two documents in ArcMap using VBscript when one might be "null"

I am an Ecologist that frequently dips into GIS work but I know next to nothing about script. I copied a script I found on this site and it ALMOST works for my application. I am hopeful its a quick/...
Will M's user avatar
  • 11
0 votes
1 answer
92 views

Travel entire streets segments

I m using ArcGIS 10.4.1 and Network Analyst extension, in the network dataset properties-> Attributes. I created an attribute called PromoteStops1, next in Script Evaluators, I used the following ...
sotokan80's user avatar
0 votes
0 answers
81 views

Making two functions and then combining them in ArcGIS Network Analyst?

I am new in the VBScript world, so I am really confused with programming. I need to do this expression in my evaluator in my Network Analyst. Basically I am adding a "cost" that is my percentage of ...
gert's user avatar
  • 61
0 votes
2 answers
3k views

Splitting (stacking) labels in ArcMap in multiple lines using vbScript?

I want to show labels in ArcMap on multiple lines. The label I have is written as: Caritas Lebanon Migrant Center, DRC, Handicap International, NRC, SCI. I want to show it in separate lines. e.g.: ...
Mehmud's user avatar
  • 591
0 votes
0 answers
113 views

CAD Equivalent of Maplex and VBScript for Labeling

Is there a CAD equivalent of maplex functionality and VBScript usage to produce custom labels? I'm pulling a shapefile into CAD, but not sure what support there is to intelligently label the ...
GIS_GOD's user avatar
  • 389
0 votes
1 answer
830 views

ArcMap Python script for attribute split, replace and concatenate [closed]

I have a problem with attribute table which I'd like to learn to solve without MS Excel. The Shapefile I have, has an attribute field, which consists of 3 parts, separated by ";" -sign. Here is an ...
Sisuaski's user avatar
  • 379
2 votes
1 answer
56 views

How to create a directory in Scripter Automation [closed]

Is it possible to create a directory in Scripter Automation? I need to call ActiveX plugin. In VB you can call it with My.Computer.FileSystem.CreateDirectory("C:\Documents and Settings\AllUsers \...
Hab's user avatar
  • 53
0 votes
1 answer
1k views

if-then statement using VBscript not working

I'm trying to reclass from the value of field using if then statement. the statement is like this.. In the figure above, what is making the result not work on my ArcGIS?
eyndra phaksi's user avatar
1 vote
1 answer
93 views

Creating unique identifier for cadastral parcels in ArcGIS 10.5?

Creating unique identifier for cadastral parcels in ArcGIS 10.5 (ArcView)? I'm adding selected parcels to a feature class and I would like to have a text prefix and then three or four digit number ...
Scott_B's user avatar
  • 305
3 votes
2 answers
29k views

Remove last 5 characters with Field Calculator in ArcGIS Desktop? [duplicate]

I wonder how to delete a word (or the last 5 characters) using the field calculator in ArcGIS 10.2. I have a column such as: Paris City; London City; Berlin City I need to remove "City", to be left ...
ADG's user avatar
  • 67
1 vote
1 answer
809 views

Using Attribute Assistant to update field when value in another layer is updated?

I have been searching for an AA method that can update our CP system status field to "UP" in our gas main layer whenever a control point test location is created or modified on that gas main feature. ...
Nicholas's user avatar
3 votes
1 answer
595 views

Trying to shorten length of a field using field calculator

I currently have a field that has text for a hyperlink to a photo that I am trying to shorten. I only need the name of the file at the end but the length of the name varies by a few characters. The ...
Tim Woodfield's user avatar
1 vote
1 answer
232 views

How to translate VBScript to Python-parser in Field Calculator

How do I translate the following VBScript code in Label Expression to Python using the Python-parser? Function FindLabel ( [MHUNIT], [BLDG_NUM] ) If Not IsNull( [MHUNIT] ) Then FindLabel = [MHUNIT] ...
Ms05's user avatar
  • 125
-3 votes
1 answer
67 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( [...
theo's user avatar
  • 1
-2 votes
2 answers
3k views

vb script for carriage return in label string over 50 character long

IN ArcGIS, what is the vbscript in the label expression box to build a label which has the outcome that if the string is over 50 characters long then the label should be formatted over 2 lines.
Marc B's user avatar
  • 13
2 votes
2 answers
742 views

Conditional Labels, Multiple Labels ArcGIS

I'm attempting to write a code to show 6 fields that all have some Null values. The fields will have accompanying text labels that are not a field, and each one needs to be on a different line. The ...
G.Daigle's user avatar
2 votes
1 answer
1k views

Using Field Calculator to assign consecutive letters for each feature?

I have a feature class generated in ModelBuilder using a transect script that contains multiple transects. Before moving on to further build the survey I would like to assign ID's to each feature in ...
JMc_Swin's user avatar
4 votes
1 answer
163 views

Large Label Expression Causes Application Error

I'm having trouble with a large label expression and I keep crashing with an application error. I'm trying to display sample results as stacked: Label ID Sample depth 1 Sample Depth 2 Sample Depth ...
Adam's user avatar
  • 61