cancel
Showing results for 
Search instead for 
Did you mean: 

Debug python script in NX

Pioneer
Pioneer

HI,

 

I have created a python script in VS, now I want to attach this file to NX like in c# we do by attach to process. Can anyone help me how can I attach .py file to NX and debugg it.

3 REPLIES

Re: Debug python script in NX

Siemens Phenom Siemens Phenom
Siemens Phenom

Are you using the PTVS plugin in VS?

 

If so, edit the project properties

  • Verify that the correct file is specified as the Startup File on the General tab
  • On the debug tab, ensure that Enable Native Code Debugging is toggled ON

 

Once a break point is set and NX is running, pick Debug, Attach to Process

  • In Attach to Process Dialog, go to “Attach to” field and press “Select” button a small dialog appears, Check “Debug these code types’ radio button and check only “Native” and “Python” check box. Uncheck other filter if selected. Press Ok. Then “Attach to” field should only contain “Native code, Python code”
  • Select “ugraf.exe” from processes and press “Attach” button.

 

Run the Python script you want to debug from NX using “Journal Manager”. If there are multiple scripts, run the script which you added as startup script in Python project creation.

 

Re: Debug python script in NX

Pioneer
Pioneer

Yes, I am using PTVS plugin.

 

while attching I am getting an error "An operationis not legal in the current state."

 

Find the attached error message

Re: Debug python script in NX

Genius
Genius

Any resolution on this? I too need a python debugger for NX10/11