Show Navigation | Hide Navigation
You are here:
Geoprocessing tool reference > Data Management toolbox > General toolset > Tools

Calculate Value (Data Management) (ArcInfo only)

Release 9.3
Last modified March 8, 2012
E-mail This Topic Printable Version Give Us Feedback

Print all topics in : "Tools"


Related Topics

NOTE: This topic was updated for 9.3.1.


NOTE: This tool is available with an ArcView or ArcEditor license if the Spatial Analyst extension or the 3D Analyst extension is installed.


Returns a value based on a user-specified Python expression


Usage tips

Command line syntax
An overview of the Command Line window
CalculateValue_management <expression> {code_block} {data_type}

Parameter Explanation Data Type
<expression>

The Python expression to be evaluated.

SQL Expression
{code_block}

Additional Python code. Code in the code block can be referenced in the expression parameter.

String
{data_type}

The data type of the output returned from the Python expression. This parameter should be used in ModelBuilder to help chain Calculate Value with other tools.

String
Data types for geoprocessing tool parameters


Command line example

CalculateValue "arcgis.rand('Integer 0 100')"

Scripting syntax
About getting started with writing geoprocessing scripts
CalculateValue_management (expression, code_block, data_type)

Parameter Explanation Data Type
expression (Required)

The Python expression to be evaluated.

SQL Expression
code_block (Optional)

Additional Python code. Code in the code block can be referenced in the expression parameter.

String
data_type (Optional)

The data type of the output returned from the Python expression. This parameter should be used in ModelBuilder to help chain Calculate Value with other tools.

String

Data types for geoprocessing tool parameters


Script example

import arcgisscripting
gp = arcgisscripting.create()

for x in range(0, 50):
    print gp.CalculateValue("arcgis.rand('Integer 0 100')")

Please visit the Feedback page to comment or give suggestions on ArcGIS Desktop Help.
Copyright © Environmental Systems Research Institute, Inc.