Showing results for 
Search instead for 
Do you mean 
Solved! Go to solution

Run Method in the Background of NX C# NXOpen

[ Edited ]

Hi Guys !


Is their a NXOpen Method to run another Method which do some Stuff in the Background without updating the view all the time only at the end.


i tried with Thread and Backgroundworker.

But with these two function i end up in the Background of Windows.


Has somebody an idea ?


THanks !!

Accepted by topic author Ildon
‎06-08-2016 06:57 AM

Re: Run Method in the Background c#

[ Edited ]

If you just want to prevent the display updating you could try the wrapper for:


Once your work is finished call the wrappers for:


Not sure if any of this has made it to NXOpen yet without having to use the wrappers. I'm still on NX8.5


PS: Using threads in NXOpen code to do work on the model is fraught with danger and not recommended by Siemens.

Graham Inchley Snr R&D Engineer (Systems Development), Sandvik Coromant
Lenovo ThinkPad W540, Win7, 16GB. Developing in: Java | C | C# | KF
Production: NX8.5.3.3 MP11 64bit Testing: NX9.0.2.5

Re: Run Method in the Background of NX C# NXOpen

Here's how to do it in


' turn the display off



<  Construction Geometry Code  >


' turn the display back on again


' regenerate the display so it matches what's been going on - very important!



Another trick when iterating on geometry is to used the undo marks.  I usually wrap iterative geometry code within undo marks.  For example:


For i as integer = 0 to 100

Dim markId1 As Session.UndoMarkId

markId1 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "EnlargeAndSplit")


<Do some geometry creation here>


theSession.UndoToMark(markId1, "EnlargeAndSplit")




theSession.DeleteUndoMark(markId1, "EnlargeAndSplit")