ArcGIS Desktop

  • ArcGIS Pro
  • ArcMap

  • My Profile
  • Help
  • Sign Out
ArcGIS Desktop

ArcGIS Online

The mapping platform for your organization

ArcGIS Desktop

A complete professional GIS

ArcGIS Enterprise

GIS in your enterprise

ArcGIS Developers

Tools to build location-aware apps

ArcGIS Solutions

Free template maps and apps for your industry

ArcGIS Marketplace

Get apps and data for your organization

  • Documentation
  • Support
Esri
  • Sign In
user
  • My Profile
  • Sign Out

ArcMap

  • Home
  • Get Started
  • Map
  • Analyze
  • Manage Data
  • Tools
  • Extensions

About manipulating the text on hatches

A hatch definition may or may not be labeled. When labeled, you have control over things such as the text symbol that is used and whether the text will automatically be flipped as the direction of the route changes.

By default, the text associated with a hatch is the route measure at the hatch location. This text can be supplemented with a prefix and/or suffix value.

For more advanced needs, you can programmatically generate a hatch's text by writing a script in Microsoft VBScript or JavaScript. Your script can include any valid statements those programming languages support.

When writing a script, you access the route measure for each hatch using the esri_measure constant value.

The following script, which could be used in step 10 of How to generate the text on hatches using a script, tells the hatching algorithm to not label a hatch if its measure value is within 0.1 measure units of the value stored in a field named MMAX. This method can be used instead of an end hatch tolerance that tells the hatch algorithm not to draw either the hatch or its label.

Function FindLabel (esri__measure, [MMAX]) 
	mmax = [MMAX] 
	m = esri__measure 
	if (mmax - m) <= 0.1 then 
	  FindLabel = "" 
	else
	  FindLabel = cstr(round(m,2)) 
	end if 
End Function

For more information on VBScript and/or JavaScript, click the Help button on the Hatch Text Expression dialog box.

Related topics

  • About hatching route feature classes
  • About displaying hatches
  • Hatching options
  • How to generate the text on hatches using a script

ArcGIS Desktop

  • Home
  • Documentation
  • Support

ArcGIS

  • ArcGIS Online
  • ArcGIS Desktop
  • ArcGIS Enterprise
  • ArcGIS
  • ArcGIS Developer
  • ArcGIS Solutions
  • ArcGIS Marketplace

About Esri

  • About Us
  • Careers
  • Esri Blog
  • User Conference
  • Developer Summit
Esri
Tell us what you think.
Copyright © 2021 Esri. | Privacy | Legal