Cancel
Showing results for 
Search instead for 
Did you mean: 

NX open hangs with GUI ...how to select multiple objects in NX

Pioneer
Pioneer

To all,

 

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.

 

 

Thanks

Regards

Adit

 

 

 

9 REPLIES

Re: NX open hangs with GUI ...how to select multiple objects in NX

Pioneer
Pioneer

Hi,

 

First of all Visual Studio 2017 is not supporting to  NX10.

For details please go through below document.

 

https://docs.plm.automation.siemens.com/tdoc/nx/11/release_notes#uid:index_xid920453:xid920496:xid38...

 

 

 

Re: NX open hangs with GUI ...how to select multiple objects in NX

Pioneer
Pioneer
But II'm able to run .dll made from VS2017 in nx10.
I don't know how it works then..

Re: NX open hangs with GUI ...how to select multiple objects in NX

Honored Contributor
Honored Contributor

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.

Re: NX open hangs with GUI ...how to select multiple objects in NX

Genius
Genius

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

Re: NX open hangs with GUI ...how to select multiple objects in NX

Siemens Phenom Siemens Phenom
Siemens Phenom

Why not combine both dialogs into a single Block Styler dialog and get rid of the Winform all together?

Re: NX open hangs with GUI ...how to select multiple objects in NX

Pioneer
Pioneer

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.  

Re: NX open hangs with GUI ...how to select multiple objects in NX

Pioneer
Pioneer
Hello

Can you please share the full sample code with example ?

Re: NX open hangs with GUI ...how to select multiple objects in NX

Siemens Phenom Siemens Phenom
Siemens Phenom

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.

Re: NX open hangs with GUI ...how to select multiple objects in NX

Pioneer
Pioneer

Thank you ! That's what I wanted !