I am not sure of the correct way to decribe it as I am new to NXopen programming...
I created a GUI using Winforms using Visual studio 2017 with the NX Block UI styler and it's all working fine in NXopen.I run it in Nxopen by making a .dll file from VS2017 and executing it in NXopen. I have made a button on the GUI that will select the curves drawn in the Drawing mode in NXopen and divide it into several segments. It's working in NXopen perfectly without GUI.
However, when I integrate with VStudio and then try to execute it in NXopen. My GUI interaction is lost. I am not able to select anythiing after that. i think it's something to do while selecting multiple objects with "theUI.SelectionManager.SelectTaggedObject" when I am going to select the user given curve.
Basically I want to be able to access both the GUI and as well as select window from NXopen.
I want to actually back and forth in between the both.
How can I do it?
Please give your valuable suggestions.
I'll attach a screenshot of my problem.
Solved! Go to Solution.
First of all Visual Studio 2017 is not supporting to NX10.
For details please go through below document.
VS2017 will probably work just fine with NX 10 (especially if you are using VB or C#). However, that combination is not "officially" supported by Siemens. Basically, this means that if your problem is a result of an incompatibility between VS2017 and NX 10; it will most likely not be patched. Rather, they will point you to the supported version combination. However, I suspect that the issue here is the code logic and not a version incompatibility.
It sounds like you may want to use a "modeless" form for input; if you search the forum for "modeless form", you should find a few other threads on the subject.
if you want to use a winform in NX and still be able to select object in the GUI then best way is tu start a separate thread.
sub Main() frmMain.Show() NXOpenUI.FormUtilities.ReparentForm(frmMain) NXOpenUI.FormUtilities.SetApplicationIcon(frmMain) 'start separate thread. Needed to update model during edit of the parameters (move components and rotate components) Dim checkThread As New Thread(New ThreadStart(AddressOf IsFormDismissed)) checkThread.Start() End Sub Sub IsFormDismissed() Do If frmMain.IsDisposed = True Then UnloadNXLibrary() End If Thread.Sleep(500) Loop End Sub
Evolve Consulting bvba
Freelance NX & Teamcenter consultant
I browsed through some threads and tried calling "form.Show()" instead of "form.ShowDialog()" for modeless form but then my GUI is not visible anymore and I can't select the functionality to be driven from that GUI Winform.
When you post your form with Show(), you must change your unload option to either Explicitly or AtTermination.
If you leave it set to Immediately, your form disappears as soon as it is posted, which sounds like what happened.