Sign up ×
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 am trying to build a model which uses two simple scripts, Script A and Script B. I want to use arcpy.SetParameterAsText to set an output in script A, which is then used as an input in script B. In the screenshot the output is datetime. But for some reason script B is not executing.

enter image description here

EDIT:

Script B will run on itws own, but it won't display the parameter passed by script A

Script A

enter image description here

Script B:

enter image description here

share|improve this question
    
Does the second script work if you run it by itself? It also looks like you have two outputs from your first script, not just one. Are they both being set properly? –  Evil Genius Nov 11 '13 at 13:04
1  
Maybe you could add the complete error code to the question. The screenshot does not help on that. –  Ardit Sulce Nov 11 '13 at 13:09

1 Answer 1

I see two issues.
First, it doesn't look like you are actually setting the output parameter.

In the first script, you have:

folder = arcpy.GetParameterAsText(0)
outfolder = arcpy.GetParameterAsText(1)

and then later:

arcpy.SetParameterAsText(0,'pom')

That last line essentially tries to assign 'pom' to the same parameter that you got your folder variable from. I don't think that actually does anything, since your first parameter appears to be an input parameter.
And, unless I'm missing something, or you didn't post all of the code, I don't see anything that would have set an output parameter to a date value (unless that's what 'pom' means).

Second, even if the output parameter was being set properly, you wouldn't get the behavior that you wanted.
The entire script will run, then it will pass the values of the parameters into the next script. Since you are setting those values in a for loop, only the last value will actually get passed.
It looks like you are trying to make your own model iterator, but I don't think that's possible in this fashion.

share|improve this answer

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.