I am trying to use visual studio to develop an application for NX. I created a shortcut for NX and put it to desktop and set its path as shown
The target path is
In visual studio, I added this shortcut to the solution and it forbids me to doing that. This reason is that the target path is incorrect.
In visual studio, here is what I got.
The file path suddenly became C:\Program Files (x86)\Siemens...
My guess is that Visual studio caches the path for my earlier installation of NX. So does anyone know how to fix the problem?
Thanks in advance
This is a bit off topic, perhaps, but ...
Why are you adding ugraf.exe to your Vis Studio solution ??
I was trying to use NX exe as external startup program during debugging but realized that VS was not able to complete the operation.
So I added it to solution to see if I can get some clue on that.
There is a description of two available debugging techniques in the "Getting Started with SNAP" guide. It's the last section in chapter 3.It talks about debugging programs that call SNAP functions, but programs that call NX/Open functions can be debugged in exactly the same way. Here is what it says (minus the pictures):
The full version of Visual Studio (but not the Express edition) provides an excellent debugger that lets you step through your code one line at a time, watching what’s happening as it executes. In particular, you can set “breakpoints” that pause the execution of your code, allowing you to examine variable values. This is a very good way to find problems, obviously. The techniques used with SNAP and NX Open programs are a little unusual because you are debugging code called by a “Main” function that you don’t have access to (because it’s inside NX). This means that using the normal “Start Debugging” command within Visual Studio is not appropriate. There are two alternative approaches, as outlined below, but neither of these is available in Visual Studio Express editions.
First, you write System.Diagnostics.Debugger.Launch() somewhere near the beginning of your code, and then you run your application in the normal way using File-->Execute-->NX Open. When execution reaches the Debugger.Launch call, the Just-In-Time Debugger dialog will appear, asking you which debugger you want to use:
Double-click on the debugger for your current project, as shown in the picture above, and you will be taken back to Visual Studio with your code “paused” at the Debugger.Launch() line, ready to begin stepping through it.
Within Visual Studio, choose Tools-->Attach to Process (or press Ctrl+Alt+P), and double-click on the NX process (ugraf.exe) in the list of available processes. Again, run your application using File-->Execute-->NX Open, and you will arrive back in Visual Studio with your code “paused” at the first breakpoint.
Regardless of which of the two approaches you used, you are now ready to step through your code. The available options are shown in the Debug menu or on the Debug Toolbar within Visual Studio. For information on how to use the debugger facilities, please consult one of the many tutorials available on the internet.