model builder, in-line variable substitution, use of 2 for one param

1853
1
01-11-2012 07:06 AM
LorenMueller
Occasional Contributor
Hi,
I am setting up a geoprocessing service in ArcGIS Server v10.

I would like to be able to use 2 variables in-line for an output parameter.

What currently works for me is this:
%scratchworkspace%\FileName.zip
In this one, FileName is a hard coded name, and the file always has to be named 'FileName.zip'.

What I would like to be able to do is concatenate the scratch workspace var and a file name var, like this:
%scratchworkspace%\%FileName%.zip
where %FileName% is an input parameter defined by the user.

My attempts so far have failed.  The model builder seems to ignore the first in-line var, and only sees the second one.
Has anyone had any luck stringing something like this together? Any ideas?
Thanks!
0 Kudos
1 Reply
KevinHibma
Esri Regular Contributor
This workflow is supported and should work as you've outlined.

For example, you have a simple model, with only buffer in it.
The output path of your buffer tool can point at:
%scratchworkspace%\%MyName%.shp

You can have an input variable as a string, in the model called MyName, and as you'd expect, the input value of this string gets used in the 2nd output inline variable.

When you say Modelbuilder is ignoring the first inline variable (scratchworkspace) - how so? I assume you're trying to run the model you created? Whats the output path look like from execution? Remember when running in ArcMap, the scratchworkspace inline variable is based off the Scratch Workspace environment setting. Where ever this environment setting points at, the inline variable will evaluate to that at run time and in the above example, write output there.
0 Kudos