This tool is only available from ModelBuilder for use in models. The tool is not available from the Geoprocessing pane or from Python.
The Expression parameter only supports Python expressions. Other scripting languages are not supported.
Use the Expression parameter for short one line expressions. Use the Code Block parameter for more complicated expressions, such as multiline calculations or logical operations (if, then). The Code Block parameter cannot be used on its own; it must be used in conjunction with the Expression parameter.
Variables created in ModelBuilder can be used by this tool, but they cannot be used directly in the Expression parameter. To use a variable in the expression, enclose the variable name in percent signs (%) or double-click the variable name in the Variables list to add it to the Expression parameter.
To use a Python function in an expression, double-click a function in the Functions list to add it to the Expression parameter.
You cannot access model variables in the Code Block parameter. These variables must be passed to the code block from the expression. To do this, create a function definition in the Code Block parameter and reference the definition in the Expression parameter.
The Data Type parameter is used in ModelBuilder to help chain the output of this tool with other tools. For example, if you use this tool to calculate a distance for use as input to the Buffer Distance parameter of the Buffer tool, specify Linear Unit for the Data Type parameter value.
In Python, proper indentation is part of the syntax. The indentation level (two spaces or four spaces) does not matter as long as it is consistent throughout the code block.
Note:
When writing equivalent Python scripts, use standard Python statements instead of using this tool.
Parameters
Label
Explanation
Data Type
Expression
The Python expression that will be evaluated.
Use the Expression parameter for short one line expressions. Use the Code Block parameter for more complicated expressions, such as multiline calculations or logical operations (if, then). The Code Block parameter cannot be used on its own; it must be used in conjunction with the Expression parameter.
SQL Expression
Code Block
(Optional)
A Python code block. The code in the code block must be referenced in the Expression parameter.
String
Data type
(Optional)
Specifies the data type of the return value of the Python expression. This parameter helps chain Calculate Value with other tools.
3D Object Feature Layer—3D Object Feature Layer
Address Locator—Address Locator
Analysis Cell Size—Analysis Cell Size
Annotation Layer—Annotation Layer
Any Value—Any Value
ArcMap Document—ArcMap Document
Areal Unit—Areal Unit
BIM File Workspace—BIM File Workspace
Boolean—Boolean
Building Discipline Layer—Building Discipline Layer
Building Scene Discipline Layer—Building Scene Discipline Layer
Building Layer—Building Layer
Building Scene Layer—Building Scene Layer
CAD Drawing Dataset—CAD Drawing Dataset
Calculator Expression—Calculator Expression
Catalog Layer—Catalog Layer
Catalog Root—Catalog Root
Cell Size—Cell Size
Cell Size XY—Cell Size XY
Composite Layer—Composite Layer
Compression—Compression
Coordinate System—Coordinate System
Coordinate Systems Folder—Coordinate Systems Folder