cancel
Showing results for 
Search instead for 
Did you mean: 

using NX 'Progress Bar' in a journal

Phenom
Phenom

To all

 

The macro/journal I am thinking about may take some time to process all the data required. I am currently using

 

InfoWindow.WriteLine ("Macro is here and is doing that")

 

at key locations to let the user know what is happening Is there a way of using the NX Progress Bar to display a % progress status? I know it can be done in Excel using Application.StatusBar=

 

any idea if that can be done in NX journal/macros?

 

Thanks

 

Regards

JXB

 

Production: NX9.0.3.4, NX10.0.2.6
Development: VB.NET (amateur level !)
9 REPLIES

Re: using NX 'Progress Bar' in a journal

Phenom
Phenom

I don't think this is possible, but I for one think it would be a nice addition to NXOpen.

I've often wanted to show a progress bar in a BlockDialog, but there is nothing. Using NX's main progress bar would solve this issue too.

Maybe an ER?

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: using NX 'Progress Bar' in a journal

Phenom
Phenom

someone suggested using

 

Dim ufs As UFSession = UFSession.GetUFSession()
ufs.Ui.SetPrompt("text")

 

so I tested the following

 

Option Strict Off
Imports System
Imports NXOpen
Imports NXOpen.UF

Module StatusBar

Dim theSession As Session = Session.GetSession()
Dim ufs As UFSession = UFSession.GetUFSession()
'Dim ui As UI = UI.GetUI()

Sub UpdateStatusBarTest()

   ufs.Ui.SetPrompt("this is is the promt %")

End Sub
    
End Module

 

 but I am getting an error msg stating : No main found

 

Any idea(s)?

 

Thanks

 

Regards

 

JXB

Production: NX9.0.3.4, NX10.0.2.6
Development: VB.NET (amateur level !)

Re: using NX 'Progress Bar' in a journal

Phenom
Phenom

In the module code, you need a subroutine named "Main". This is the subroutine that will get executed when the journal starts.

 

The .SetPrompt command will place a short text message in the user prompt area. Not the same as a progress bar, but perhaps better than nothing.

Re: using NX 'Progress Bar' in a journal

Phenom
Phenom

Thanks. One should pay a bit more attention!

with a simple loop, one can see the "progress". Assumign that the journal/macros is "hoilding" the NX session it can indeed be handy. The only way around is to write a windows form to display a progress bar

 

 

for i = 1 to 5000
  ufs.Ui.SetPrompt("this is is the prompt: "& cstr(i))
next

 

Thanks

 

Regards

 

JXB

Production: NX9.0.3.4, NX10.0.2.6
Development: VB.NET (amateur level !)

Re: using NX 'Progress Bar' in a journal

Phenom
Phenom

how about using 

 

Imports system.windows.forms

 and use the ProgressBar on a user-defined form?

Can such form be called by a NX sub?

 

Thanks

 

JXB

Production: NX9.0.3.4, NX10.0.2.6
Development: VB.NET (amateur level !)

Re: using NX 'Progress Bar' in a journal

Phenom
Phenom

I know some people do use Windows Forms inside NX, but here it is generally preferred to use BlockStyler.

Also we are mainly using Java, so Windows Forms is not an option. I've dabbled with SWT and a colleague has actually released a small tool using SWT, which works fine, but we have a lot of automation built around BlockStyler so that is still the preferred option for us.

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: using NX 'Progress Bar' in a journal

Phenom
Phenom

Thanks Graham for the info. I have started looking at the GUI style but I have not found any "pre-defined" bar for the "problem". I have also started gathering info on the use of dll as I have not understood yet how to deploy the macros/journals. I think this will be required if going down the "Imports Windows.Form" route. I have found a bit of stuff on GTAC on this matter but it will take me sometime to understood this (as I have never done it!)

 

Thanks

 

Regards

 

JXB

Production: NX9.0.3.4, NX10.0.2.6
Development: VB.NET (amateur level !)

Re: using NX 'Progress Bar' in a journal

Esteemed Contributor
Esteemed Contributor

Incredibly bad kludge suggestion...

Add a bitmap to your dialog, initially hidden

show it when you start working, and keep replacing the bitmap with other bitmaps showing "progress"...

Not sure if you can force the block styler dialog to update its display in a timely manner?

Ken Akerboom Sr CAx Systems Engr, Moog, Inc.
Production: NX10.0.3.5 MP5 + patch/TC11.2
I'd rather be e-steemed than e-diseaseled


Re: using NX 'Progress Bar' in a journal

Phenom
Phenom

I have added a label at the bottom of a dialog, a bit like a status area, and updated the label text as progress continued. That worked OK, but for that application there were just a few descreet steps that only lasted a few seconds.

Another thing I've used in the past was a couple of bitmap labels that had red and green traffic lights (like we used to have in UG v10, oh the memories Heart). These just swapped from green to red when a sequence started and back top green when it finished.

I've not actually tried updating a bitmap label with a series of progressing images. This could work, but as you say it would be a real kludge having to work out the image to use depending on the amount of progress that has passed.

 

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