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
0 votes
1 answer
143 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. ...
  • 3
2 votes
0 answers
66 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 ...
  • 21
0 votes
1 answer
28 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"
1 vote
1 answer
121 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 ...
  • 45
0 votes
0 answers
26 views

Updating a field in Table A with values in Table B using Attribute Assistant

My first issue is trying to pull all values that match a GUID in Table A from Table B and add the SUM of those values (additional_cable) to Table A (i.e Table B can have multiple matched values). ...
0 votes
1 answer
399 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 ...
  • 103
0 votes
1 answer
74 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 ...
  • 1
0 votes
1 answer
161 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. ...
0 votes
1 answer
179 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:...
0 votes
1 answer
193 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 ...
  • 35
3 votes
2 answers
175 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 ...
  • 33
0 votes
0 answers
47 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 ...
0 votes
1 answer
44 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 ...
  • 9
0 votes
0 answers
50 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, ...
  • 129
2 votes
1 answer
150 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 ...
  • 21
6 votes
1 answer
154 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(...
  • 369
0 votes
1 answer
83 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 ...
1 vote
1 answer
33 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 ...
  • 23
0 votes
1 answer
45 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 (...
  • 81
1 vote
1 answer
86 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 ...
  • 81
1 vote
1 answer
117 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] &...
0 votes
2 answers
55 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 ...
  • 57
-2 votes
1 answer
152 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 "...
1 vote
1 answer
254 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 ...
1 vote
0 answers
161 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 ("...
0 votes
1 answer
2k 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 ...
  • 51
1 vote
2 answers
1k 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 ...
2 votes
1 answer
6k views

Writing If-Then statement in ArcGIS Pro field calculator using Python?

I've been using ArcGIS Pro over ArcMap recently because ArcMap is giving me some incorrect summary statistics that I use to populate a data field in a number of feature classes. The problem is that I'...
0 votes
0 answers
29 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 ...
  • 335
1 vote
1 answer
8k 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 ...
1 vote
0 answers
231 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/...
  • 11
0 votes
1 answer
91 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 ...
0 votes
0 answers
74 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 ...
  • 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.: ...
  • 581
0 votes
0 answers
95 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 ...
  • 369
0 votes
1 answer
637 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 ...
  • 341
2 votes
1 answer
48 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 \...
  • 53
0 votes
1 answer
956 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?
1 vote
1 answer
79 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 ...
  • 305
2 votes
2 answers
22k 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 ...
  • 57
1 vote
1 answer
728 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. ...
3 votes
1 answer
379 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 ...
1 vote
1 answer
216 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] ...
  • 123
-3 votes
1 answer
63 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( [...
  • 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.
  • 13
2 votes
2 answers
688 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 ...
2 votes
1 answer
796 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 ...
4 votes
1 answer
150 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 ...
  • 61
1 vote
1 answer
508 views

Converting label expression from VBScript to Python in ArcGIS Desktop?

I have a feature class with label expression in VB script. I do not have the skill to convert a VB script to a python script. Here is the VBScript:- Function FindLabel ( [DESCRIPTION] ) if (left(...
2 votes
1 answer
216 views

Using CJK character orientation in label expression of ArcMap?

I'd like to set label expressions by VBscript in ArcGIS, here comes the problem. Since labels are constructed by Chinese and English, so I set the label expression like: If CJK character is checked, ...