Help for Data type in Model Builder's Calculate Value

704
1
Jump to solution
01-27-2012 01:15 PM
SamJenkins1
New Contributor III
Hi,

I'm looking for some help formatting the output of my calculate value process so that it fits a particular data type to be used in a geoprocessing tool.

Specifically I'm trying to get an origin for the Grid Index Features tool. I created a Calculate Value and wrote an expression using variables defined in the model, set the Data type to "Point". Now, I think, I need to set the output of my calculate value function so that it matches the format of the Point data type. But I cant seem to find what that format should be.

Any help would be appreciated. Is there help page for Calculate Value that I've missed?

Cheers
Sam
0 Kudos
1 Solution

Accepted Solutions
DaleHoneycutt
Regular Contributor
The help topic Data types for geoprocessing parameters may help you. 

The string representation of a point data type is simply a string with the x and y coordinate separated by a space.  Code sample #4 for Grid Index Features shows using a point for the origin_coord:

import arcpy from arcpy import env arcpy.env.workspace = "C:\data\ProjectData.gdb" arcpy.GridIndexFeatures_cartography("gridIndexFeatures", "", "", "", "",                                     "1000 meters","1000 meters",                                     "-6000000 -1600000", "15", "20",)


In calculate value, your code block routine just needs to return a string with the x and y coordinate, separated by a space.

View solution in original post

0 Kudos
1 Reply
DaleHoneycutt
Regular Contributor
The help topic Data types for geoprocessing parameters may help you. 

The string representation of a point data type is simply a string with the x and y coordinate separated by a space.  Code sample #4 for Grid Index Features shows using a point for the origin_coord:

import arcpy from arcpy import env arcpy.env.workspace = "C:\data\ProjectData.gdb" arcpy.GridIndexFeatures_cartography("gridIndexFeatures", "", "", "", "",                                     "1000 meters","1000 meters",                                     "-6000000 -1600000", "15", "20",)


In calculate value, your code block routine just needs to return a string with the x and y coordinate, separated by a space.
0 Kudos