Dear ADOxx-Team!
I got an interesting error while running a RUN_VOLUME_ANALYSIS with AdoScript. The scenario is the following: I created a new model which basically uses a business process model and a working environment model to create an application model and run a capacity analysis afterwards. The results of this simulation are stored in a file. The button "Plot Regression Tree" shown in the following picture executes the subsequent AdoScript:

1CC "Core" GET_ATTR_VAL objid: (thisobjid) attrname:"Path to R"
2SETG pathtor: (val)
3CC "Core" GET_CONNECTORS objid: (thisobjid) in
4SETG incommingrelations: (objids)
5
6CC "Core" GET_ATTR_VAL objid: (VAL(incommingrelations)-3) attrname:"Business process model" format:"%m"
7CC "Core" GET_MODEL_ID modelname: (val) modeltype: ("Business process model")
8SETG bpmodelid: (modelid)
9
10CC "Core" GET_ATTR_VAL objid: (VAL(incommingrelations)-3) attrname:"Working environment model" format:"%m"
11CC "Core" GET_MODEL_ID modelname: (val) modeltype: ("Working environment model")
12SETG wemodelid: (modelid)
13
14SET appModelName: ("AppModelRegTree" + (STR(round(random()*10000))))
15CC "Core" CREATE_APP_MODEL (appModelName) bpmodelids: (STR(bpmodelid)) wemodelid: (wemodelid)
16
17CC "AdoScript" GET_TEMP_FILENAME
18SETG resultsfile: (filename)
19CC "AdoScript" FWRITE open file: (filename) append:1
20CC "AdoScript" FWRITE text: ("EXECDAYS;PERSCOS;COSTS")
21
22FOR i from:0 to: (50) {
23CC "Simulation" RUN_VOLUME_ANALYSIS appmodelname: (appModelName) no-error-messages:1 auto-read-only:1 no-result-window auto-close:1 process-results:{JOB mode:"process-related" period-type:"per-year" handler:"HANDLE_SIMUL"}
24}
25
26CC "AdoScript" FWRITE close
When the script is executed, the following error appears:

While debugging I noticed that this
1FOR i from:0 to: (50) {
2CC "Simulation" RUN_VOLUME_ANALYSIS appmodelname: (appModelName) no-error-messages:1 auto-read-only:1 no-result-window auto-close:1 process-results:{JOB mode:"process-related" period-type:"per-year" handler:"HANDLE_SIMUL"}
3}
must be the critical part, however, I don't know why this error arises. The more interesting thing is, that the script executes smoothly after I click the OK-Button on the error message but the Model Toolkit crashed immediately after the execution.
Why is that the case?