1

Software Spec: ArcMap 10.2.1 Advanced Licence.

I have a single folder, let's call it "Processing". Inside this folder are 15 empty folders. Let's call these "Output_1" through to "Output_15". There is nothing else in the "Processing" folder.

I am trying to use ModelBuilder to create an empty file geodatabase inside each Output folder with the same name as the folder. i.e. in the "Output_1" folder, the file gdb will be called "Output_1.gdb".

I thought this would be very straight forward using an "Iterate Workspace" iterator, where the input is the "Processing" folder.

I could then use the output workspace from the iterator as the file gdb location into the "Create file gdb" tool, and the %Name% from the iterator as the file dgb name.

However, the "Create File GDB" tool won't accept the workspace output from the iterator as the file gdb location.

I have tried changing the iterator settings so that the workspace type it looks for is only folders, but this doesn't fix this issue.

I have also tried changing the input variable (called "Processing") between a "folder" and a "workspace". This makes no difference.

Is there something fundamental I am missing? Or is this a bug?

enter image description here

If I first run just the iterator part of the model, I am then able to connect the "wokspace" output as the input location for the "Create file gdb" tool. I can then run just the "Create file gdb" tool, but obviously this only runs for the last folder that was read by the iterator.

enter image description here

  • I have solved this using a list and the parse path tool rather than an iterator. However, it would still be good to know if this can be done with an iterator. – Dan_h_b Jun 1 '15 at 12:48
4

I was able to get this to work by:

  1. Specifying that Workspace is a Precondition to Create File GDB enter image description here
  2. Using %Name%\%Name% as the File GDB Name, not as part of the location enter image description here

This results in the desired output:

enter image description here

  • Good find! I'll put an image of my solution up as well in case somebody else tries to do the same. – Dan_h_b Jun 1 '15 at 15:58
0

This is how I ended up doing it, by using a list variable for the 15 folders as the input. And the Parse type to return the "Name".

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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