I want to invoke an external exe inside NX. I am invoking this from a custom toolbar created by me.
below is the tool bar code:
TITLE Part Costing
BUTTON Part _Costing
LABEL Part _Costing
under "ACTION' I am passing the "PartCasting" which is "PartCasting.exe" file and copied inside the "startup" folder. I can see my custom toolbar appearing inside NX and when I click it; it gives error: "Could not find file PartCosting" in any of the appropriate directories.
Surprisingly when I copy the "PartCasting.dll" instead of "PartCasting.exe" it works perfectly.
Solved! Go to Solution.
Here are a couple of things to consider:
1) Did you try putting the file in an "application" folder, rather than in "startup"? In many cases NX will look in an "application" folder.
2) Was your .EXE built from .Net code (VB or C#), or was it built from C/C++? This is important, because an executable built from .Net code will run in NX just like a .DLL - it works in the current session. But an executable built from C/C++ will run as a separate process - it will not be aware of anything going on in your current session.
Jim and Steve
Thanks for your suggestions.
Well in ACTIOn yes I tried PartCosting.exe and it says "Unknown action type PartCosting.exe".
I tried putting the .exe in application folder but same error: "Could not find file PartCosting" in any of the appropriate directories."
Yes I have build the .exe/.dll in C#.net.
Apparently that is not a valid action for a toolbar. You can write a very small .DLL and use it to run your .EXE with a Shell() command...or is there any reason you could not just build your code as a class library?
I think it is also supported to run a batch script from a menu entry.
Production: NX10.0.3, VERICUT 8.0, FBM, MRL 3.1.4 | TcUA 10.1 MP7 Patch 0 (10.1.7.0) | TcVis 10.1
Development: VB.NET, Tcl/Tk Testing: NX12.0
How to Get the Most from Your Signature in the Community
I tried using .bat file to invoke the .exe but same problem.
Do you have any idea whether we can use the .bat file in ACTION?