0

I am working on Catia V5 automation and have a requirement to launch Catia by clicking a CatPart/ CatProduct if Catia is not already running. I tried the below code:

ProcessStartInfo startInfo = new ProcessStartInfo();
startInfo.FileName = @filepath; 
Process.Start(startInfo);

But I get error: System.ComponentModel.Win32Exception (0x80004005): An error occurred in sending the command to the application

Can anybody help how to solve as this code works on my machine but not in other machine. I have Catia v5 and 3dexp installed so when I tried to create instance of Catia application it opens 3d experience.

System.Type objBLType = System.Type.GetTypeFromProgID("Catia.Application");
object objBL = System.Activator.CreateInstance(objBLType);
sina123
  • 189
  • 1
  • 1
  • 13
  • Please share the full exception log. – Praveen Rai Nov 26 '18 at 10:24
  • 2018-11-26 11:43:00.702 [ERROR] System.ComponentModel.Win32Exception (0x80004005): An error occurred in sending the command to the application at System.Diagnostics.Process.StartWithShellExecuteEx(ProcessStartInfo startInfo) at System.Diagnostics.Process.Start() at AttributeExtraction.CATIAEngine.StartCatiaApplication(String filepath) in D:\Projects\AttributeExtraction\AttributeExtraction\CATIAEngine.cs:line 206 – sina123 Nov 26 '18 at 10:44
  • Does CATIA get's launched ? Or the code fail to start even the CATIA process ? – Praveen Rai Nov 26 '18 at 11:41
  • The startup window of Catia appears but then suddenly a pop up" Catia has stopped working" and then I have to close the program. – sina123 Nov 26 '18 at 11:43
  • Check the file associations. For win10 Default App Settings-> Choose Default apps by file type. Make sure CatPart / CatProduct are associated with CATIA. – Praveen Rai Nov 26 '18 at 12:05
  • Also, just try running the application as Administrator – Praveen Rai Nov 26 '18 at 12:05
  • It works perferctly in my machine- Win10 with Process.Start, but not in my colleague and a VM which is Win7. When i tried running the app as admin i get the following error in log and it does not launch Catia: System.ComponentModel.Win32Exception (0x80004005): No application is associated with the specified file for this operation – sina123 Nov 26 '18 at 12:26
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/184268/discussion-between-praveen-rai-and-sina123). – Praveen Rai Nov 26 '18 at 13:09

0 Answers0