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.

Does anyone know how/if you can use in-line variable substitution for an input path name in ModelBuilder for ArcGIS 10?

I used "get field value" to retrieve a code from one feature class, and I want to substitute that text string in two places in another input variable pathname.

For instance, if I used "get field value" to retrieve the code "ABC123", I would use that to call up a raster (make raster layer) with this path name: "D:\Data\Rasters\%ABC123%\el_%ABC123%

Does anyone know if this will work?

ModelBuilder won't recognize this as a valid path name right now.

share|improve this question
    
As far as I know, you can't do this in Model builder, though it sure would be useful. See gis.stackexchange.com/questions/480/…. It was written when I was using arcgis 9.3, maybe v10 is different. You can do this in python though. –  matt wilkie Aug 30 '11 at 17:25
add comment

2 Answers 2

It is possible to do this using the Calculate Value tool, see Add arbitrary code to Arcgis model builder?

share|improve this answer
add comment

You need quotes.

D:\Data\Rasters\%ABC123%\el_%ABC123%

should be

D:\Data\Rasters\'%ABC123%'\el_'%ABC123%'

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.