Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

How to debug NXOpen C++ Application

Status
Not open for further replies.

yadvdinesh

Aerospace
Apr 13, 2015
31
Hi Can any one tell me how to debus NXOpen C++ application. I am using VS2008 for NX7.5 The information given in NXOpen Help file is not enough. First I am unable to find option to run an external program in Visual studio project properties. When I am trying to attach an exiting process to VS project I am getting error as Unable to find symbol.
 
 http://files.engineering.com/getfile.aspx?folder=4214a401-36ae-4bde-965a-66278197fd31&file=error_screenshot.JPG
Replies continue below

Recommended for you

Are you able to run the external NXOpen application? If No.
Change the NXOpen, NXOpen.UF,.. Refences property "Copy Local" to True. Try executing the program.

To run the NXOpen program in Visual Studio itself then perform the following.
1) Open Start Menu-> Progames->NX Folder->NX Tools->Command Prompt
2) In command prompt type "Start devenv"
3) Visual studio will be opened then Open your project and execute. It will run automatically.

Regards,
Mukundh
 
Here's how we roll:

1) In VS build your .dll.
2) In Project Properties, under Debug, set Start External program to C:\Program Files\Siemens\NX 10.0\UGII\ugraf.exe (or similar).
3) "Start" in VS will then launch NX.
4) Ctrl-U in NX to select and run your .dll.
5) Breakpoints will be hit, exceptions will drop back into NX.

Paul

Paul Turner
CAD & Process Engineer
Mastip Technology
 
Hi Paul,

Your way of working can be used only for Internal applications not for external program.

Regards,
Mukundh
 
Thanx Paul & Mukundh for your reply.

I was facing problem because I am using VS2008. And in C++ project properties we dont have the option to set external program. Indeed we have something called as COMMAND & COMMAND LINE ARGUMENTS under project properties for the same purpose I believe. When I am trying to run NX by entering the path of ugraf.exe in "COMMAND", it is throwing an error on debugging "SYMBOL Not Found". So, I tried launching NX & then linked the VS project through "attach to Process" option. It got linked & from NX I ran the dll file & as Paul suggested it hit the breakpoint. For now I am working on internal applications & so it serves the purpose.

Appreciate your help.
 
If you are using additional libraries, such as Boost or Qt, beware. UG ONLY supports compile flag of -MD NOT -MDd

Regards
Carl
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor