static void Main() { System.IO.Directory.SetCurrentDirectory(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)); //create automation manager var interf = new DWSIM.Automation.Automation2(); var sim = interf.LoadFlowsheet(@"C:\Users\Daniel\Downloads\150747-205762.dwxml"); sim.SetMessageListener((s, mt) => Console.WriteLine(s)); var msobj = sim.GetFlowsheetSimulationObject("PRODUCED GAS"); msobj.SetPropertyValue("PROP_MS_104/Metano", 10); interf.SaveFlowsheet(sim, @"C:\Users\Daniel\Downloads\150747-205762.dwxml", false); var errors = interf.CalculateFlowsheet3(sim, 3600); var obj = sim.GetSelectedFlowsheetSimulationObject("compressed gas"); var temperature = obj.GetPropertyValue("PROP_MS_0"); Console.WriteLine("Solved."); Console.ReadLine(); }
static void Main() { System.IO.Directory.SetCurrentDirectory(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)); //create automation manager var interf = new DWSIM.Automation.Automation2(); var sim = interf.LoadFlowsheet(@""); sim.SetMessageListener((s, mt) => Console.WriteLine(s)); var errors = interf.CalculateFlowsheet3(sim, 3600); interf.SaveFlowsheet2(sim, @""); Console.WriteLine("Solved."); Console.ReadLine(); }