Cancel
Showing results for 
Search instead for 
Did you mean: 

How to launch a dialog without opened parts?

Experimenter
Experimenter

I'm trying to call my script from home page of NX (there are no opened parts).

 

            self.theUI = NXOpen.UI.GetUI()
            self.theDlxFileName = "sblade_wizard.dlx"
            self.theDialog = self.theUI.CreateDialog(self.theDlxFileName)

And I have an exception: "This operation can only be done on the work part"

 

How to launch it without work part?

3 REPLIES

Re: How to launch a dialog without opened parts?

Esteemed Contributor
Esteemed Contributor

You cannot display a dialog without a open part file, this is how it works.

Stefan Pendl, Systemmanager CAx, HAIDLMAIR GmbH
Production: NX10.0.3, VERICUT 8.0, FBM, MRL 3.1.4 | TcUA 10.1 MP7 Patch 0 (10.1.7.0) | TcVis 10.1
Development: VB.NET, Tcl/Tk    Testing: NX12.0

How to Get the Most from Your Signature in the Community

Re: How to launch a dialog without opened parts?

Phenom
Phenom

We have some toolboxes we want to run with no part, in this case we check if there is a part open before launching the dialog. If not we create a blank temporary part using a randomly generated name.

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

Re: How to launch a dialog without opened parts?

Experimenter
Experimenter
Thank you. I've already tried to use tkinter for a dialog creation before user opens some part. After user click a button on the tkinter's dialog the block styler dialog is appeared.