1: using System; 2: using System.Collections.Generic; 3: using System.Text; 4: using Aimms; 5: 6: namespace example 7: { 8: class Program 9: { 10: static void Main(string[] args) 11: { 12: if (args.Length != 2) 13: { 14: Console.WriteLine("Invalid number of arguments. usage: <location of AIMMS> <location of project>"); 15: return; 16: } 17: 18: ISession aimmsSession = null; 19: try { 20: aimmsSession = AIMMS.openSession(args[0], args[1]); 21: 22: Basic.setParameters(aimmsSession); 23: 24: Basic.runMainExecution(aimmsSession); 25: 26: Basic.retrieveVariables(aimmsSession, Console.Out); 27: 28: } 29: catch (Exception ex) 30: { 31: Console.WriteLine(ex); 32: } 33: finally 34: { 35: if (aimmsSession != null) 36: { 37: Console.WriteLine("closing project"); 38: aimmsSession.clearBuffers(); // discards all buffered modifications, without this call close is slower and may throw. 39: aimmsSession.close(); 40: } 41: } 42: } 43: } 44: }