Discussion Groups

Robot Structural Analysis

Reply
Active Member
20086033
Posts: 8
Registered: ‎03-13-2012
Accepted Solution

Structure verification through API

146 Views, 3 Replies
03-16-2012 05:38 AM

 

 

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?

 

Please use plain text.
Product Support
Rafal.Gaweda
Posts: 4,977
Registered: ‎04-26-2010

Re: Structure verification through API

03-16-2012 05:44 AM in reply to: 20086033

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.



Rafal Gaweda
Please use plain text.
Active Member
20086033
Posts: 8
Registered: ‎03-13-2012

Re: Structure verification through API

03-16-2012 06:21 AM in reply to: Rafal.Gaweda

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.

Please use plain text.
Product Support
Rafal.Gaweda
Posts: 4,977
Registered: ‎04-26-2010

Re: Structure verification through API

03-16-2012 07:13 AM in reply to: 20086033

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);
                }
            }
        }
    }
}

 

 



Rafal Gaweda
Please use plain text.