I tried the code you wrote, but it doesn't seem to run the API script on the model1.
The output text file that is generated using API returns 0 in the entries that are supposed to have a certain value (that is calculated in FEMAP). I guess it opens the model and then closes it (because when I include the "-prg macro1.bas" no model appears on the screen), so I suppose is running the API with an ''empty model". Is there another kind of "-prg" option code to use instead? Do you have any idea where can I find some list of these compilation options?