Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

Failed to run .exe macro from CATScript

Status
Not open for further replies.

Aleks_TS

Mechanical
Jul 5, 2020
22
IT
thread560-65187

Hi Everyone I have created one macro in Visual studio and converted it to .exe. I saw on a forum (thread560-65187) that it is working but on my Catia it doesn`t
The macro that I created works fine when I click it directly on .exe file, but with the following macros that I found on Forum it doesn't
Can anyone please help
Here are the Catscript Macros that I tried but it doesn`t work:
1.
Sub CATMain()
Dim RetVal
RetVal = Shell("C:\Users\adobrosa\Desktop\New folder\WinFormsApp1\WinFormsApp1\bin\Debug\net5.0-windows\WinFormsApp1.exe", 1)
End Sub

- here I have a message "Type mismatch Shell"

2.
Sub CATMain()
CATIA.SystemService.ExecuteBackgroundProcessus ("C:\Users\adobrosa\Desktop\New folder\WinFormsApp1\WinFormsApp1\bin\Debug\net5.0-windows\WinFormsApp1.exe")
End Sub
- Here I have the message " The method ExecuteBackgroung Processus failed"

3.
Sub CATMain()
Set WshShell = CreateObject("WScript.Shell")
WshShell.Run("C:\Users\adobrosa\Desktop\New folder\WinFormsApp1\WinFormsApp1\bin\Debug\net5.0-windows\WinFormsApp1.exe")
End Sub

4.
Sub CATMain()
dim sh,s
Set sh = CreateObject("WScript.Shell")
s ="C:\Users\adobrosa\Desktop\New folder\WinFormsApp1\WinFormsApp1\bin\Debug\net5.0-windows\WinFormsApp1.exe"
sh.Run s, 1, false
End Sub
 
Replies continue below

Recommended for you

Do you use 32-bit or 64-bit CATIA?
Build your .NET app for a platform matching CATIA, not just "Any CPU"
 
Hi
I tried to build it with 32 and 64 and it still doesn`t work
Is there any other way how I can implement this exe to Catia
 
Hi
I managed to do it
I just created a single exe file and it is working perfectly
Build and then Publish
Thank you all
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top