1

I am building a model to produce 62 separate output files. I need an easy way to change output paths on all these outputs as the input data changes. I need them to keep their naming, just change a subfolder.

I tried creating a model variable and using the "@" notation, but apparently, that does not work in paths. Also, I am having some difficulty finding any useful data on this particular part of the Model Designer.

I marked the part that needs changing between runs in the image below.

enter image description here

The solution in this answer is either too complex for my needs or I just don't understand it.

Taras
35.8k5 gold badges77 silver badges152 bronze badges
asked Feb 20 at 9:34
3
  • Are you executing the model in batch mode? Based on what should the output folder change? You want the path to be D:/Datai/Municip1/... then D:/Datai/Municip2/ ... Commented Feb 20 at 9:55
  • No. I have 2 inputs that produce 62 outputs in one run. I am looking for a way to change the output folder without changing the names of output files. Commented Feb 20 at 9:56
  • To directly answer your question, output should change based on an input of one folder in the path. Commented Feb 20 at 10:04

1 Answer 1

0

As long as your outputs are shapefiles this works:

Set the outputs to pre-calculated values like:

array_to_string( array:=
string_to_array( string:=@folder_param, delimiter:='\\'),
delimiter:='/') || '/' || 'Buffer.shp'

I believe the problem when using just the @folder_param is that the paths have backslashes in them, like C:\folder\buffer.shp when it needs to be forward slashes: C:/folder/buffer.shp.

The expression splits the folder path into an array ['C:', 'folder'] and joins it back to a string using / as delimiters.

(I select the folder C:\Users\bera\Desktop\gistest111円 when executing the model.)

enter image description here

answered Feb 20 at 17:05

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.