Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to call an automation executable from CAA ?

Status
Not open for further replies.

Talou

Computer
May 14, 2019
17
0
0
SE
Hello,

I build a Catia command in CAA.

In the CAA code, I reorganize the Geometrical Set. (that work fine)

The I need to call Delete Useless Elements. I could call the Catia command “Delete Useless Elements” with CATAfrStartCommand. But I didn’t know how to click the “OK” button on the dialog that appear.

So I build a automation .exe (in CSharp) that will launch the “Delete Useless Elements” command and handle the dialog windows or warning message that appear from that Catia command. (that work fine)

My plan was to call my automation executable from the CAA. However, when launched from the CAA code. The automation exe is not allowed to interac with Catia.
It hang on:
INFITF.Application CATIA = (INFITF.Application)Marshal.GetActiveObject("Catia.Application");

I’m calling my automation executable with system:
sysRc = system( strCommandLine.ConvertToChar() );

I guess I should have tested that before writing my automation exe…

Does someone have a suggestion how to bypass that problem?

Thank you,

Talou;
 
Replies continue below

Recommended for you

One workaround:

From CAA --> Call CATScriptUtilities::ExecuteScript(Launcher.catvbs)
and from Launcher.catvbs call -> CATIA.SystemService.ExecuteBackgroundProcessus(Automation.exe)
Then it come back to CAA and when the CAA command finish, the Automation.exe start.

The down side is no error control, no other action can be perform in the CAA after the Automation.exe did it's job.

Looking for a click OK I can use from the CAA.

tks,

T;
 
Status
Not open for further replies.
Back
Top