I'm writing a script that removes unitilised bars and i need to check for instability after removal of each bar.
Is there any method in the API that checks the model for singularities without running a full calculation?
Solved! Go to Solution.
Solved by Rafal.Gaweda. Go to Solution.
I'm writing a script that removes unitilised bars and i need to check for instability after removal of each bar.
Is there any method in the API that checks the model for singularities without running a full calculation?
No, you have to run calculation.
OK.
Is there anyway I can abort the calculations when presented with a warning? I realise that i can abot manually by clicking the dialog box that appers with the warning, but I'm looking for a way to automise this task.
Hope you can help.
Very simple example written in C# which shows how to handle the warnings generated by calculation engine and how to break the calculations if needed.
namespace MyCalc { class Program { static void Main(string[] args) { RobotOM.RobotApplication app = new RobotOM.RobotApplication(); app.Project.Open(@"c:\Temp\Pdelta.rtd"); app.Project.CalcEngine.CalcNotifyEx += new RobotOM._IRobotCalcEngineEvents_CalcNotifyExEventHandler(CalcEngine_CalcNotifyEx); Console.WriteLine(app.Project.CalcEngine.Calculate().ToString()); app.Project.CalcEngine.CalcNotifyEx -= new RobotOM._IRobotCalcEngineEvents_CalcNotifyExEventHandler(CalcEngine_CalcNotifyEx); } static void CalcEngine_CalcNotifyEx(int nCaller, string strText, string strFullText, string strCaption, int nType, int nDataType, string strSelection, out bool bHandled, out int nReturnValue) { bHandled = false; nReturnValue = 0; if (nCaller == 1) { // CALCULATIONS==1 if (!string.IsNullOrEmpty(strText)) { bHandled = true; nReturnValue = 7; // IDNO=7, break calculations Console.WriteLine(strText); } } } } }