--apply switch can be used in conjunction with the --batch switch.An example where this would be useful is when you want to change the soil and weather for each individual APSIM file and you have 10s to 100s to 1000s of APSIM files.
To do this you will need two specific files along with any APSIM files you want to change, these files are:
A config file containing ‘placeholders’
$ symbol. An example would be $weather-file-name.load BaseCl.apsimx
[Soil]=SoilLibrary.apsimx;[$soil-name]
[Weather].FileName=$weather-file-name
[SimulationExp].Name=$sim-name
run
A batch file, this is a csv file with headers that match the placeholders (minus the $ symbols)
| soil-name | weather-file-name | sim-name |
|---|---|---|
| Ahiaruhe_1a1 | 16864.met | Sim0001 |
| Ahuriri_7a1 | 19479.met | Sim0002 |
| Ailsa_5a1 | 19479.met | Sim0003 |
To run this we would run something like: "C:\Program Files\APSIM<your version number>\bin\Models.exe" --apply config-file-name.txt --batch batch-file-name.csv