Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I'm trying to create a model wherein one of the parameters is a compound variable, that is made of multiple variables joined together. How can this be done?

For Example: Create an insider buffer using Buffer(analysis) and name the output feature class from the distance parameter.

Variables:

BufferDistance = 1000
InputFC = d:\test.gdb\boundaries

Buffer tool parameters:

Input Features = %InputFC%
Output Feature Class = %InputFC%_%BufferDistance%
Distance = -%BufferDistance% Meters

A negative buffer distance is needed to create an inside buffer, but that means the %BufferDistance% variable can't be used in the output FC name. Thus the need for a compound variable.

share|improve this question
add comment

2 Answers 2

I suspect the easiest way to do it would be through Python (or VBA).

  1. Start by putting your model together, including parameters for the input and output variables.
  2. Then from the model menu export the model to a Python script
  3. Open the script in an editor of your choice (I use Eclipse with the Pydev extension, but Notepad++ works, as does IDLE).
  4. Simply set the output parameter equal to the buffer distance etc. eg:
OUPUT_NAME = ''.join(INPUT_NAME, "_", str(-BUFFER_DISTANCE), OUTPUT_SUFFIX)
  1. Run the script
share|improve this answer
2  
soo, it appears that actual answer is "you can't" :) This works, and I'll use it, but I might as well just skip model builder altogether and do everything in python. Thanks. –  matt wilkie Aug 31 '10 at 21:56
    
doesn't look like it I'm afraid. However you can add discrete pieces of script to model builder, and use those answers (not tried it myself, but see the adding a boolean example (webhelp.esri.com/arcgisdesktop/9.3/…) on the ArcGIS help). Good luck! –  om_henners Sep 1 '10 at 5:41
add comment
up vote 1 down vote accepted

I've since learned it is also possible to do this using the Calculate Value tool, see Add arbitrary code to Arcgis model builder?. It's not as involved as creating a script and adding to a toolbox.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.