cancel
Showing results for 
Search instead for 
Did you mean: 

Disabling NX warning message(s) to run a macro-How to?

Phenom
Phenom

To all,

 

Is there a way of disabling NX warning messages popping-up during the run of a macro? After some "digging" I have found the following in the documentation;

 

  NXOpen.Preferences.SessionUserInterfaceUI.DisplayAlertsOnWarnings=False


      Returns or sets the option "Display Alerts on Warnings" gives choice, whether the user wants the Diagnostic alerts appear when features contain warnings during feature creation, edit, and update.

 

My test failed with the following error message:
  References to a non-shared member requires an object reference

 

Any idea what this mean, and more importantly if this the right keyword I am looking for, how to fix it?

 

Thanks

 

Regards

 

JXB

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

Re: Disabling NX warning message(s) to run a macro-How to?

Siemens Phenom Siemens Phenom
Siemens Phenom

You don't have an object reference because you have not obtained a UI object. You need to obtain an instance of the UI class and make the setting on that:

 

Dim theUI as UI = UI.GetUI()
theUI.UserInterfacePreferences.DisplayAlertsOnWarnings = False

 

Re: Disabling NX warning message(s) to run a macro-How to?

Phenom
Phenom

Thanks for that. Good have beee there for while!

just tried and still getting the warning message

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

Re: Disabling NX warning message(s) to run a macro-How to?

Phenom
Phenom

What kind of warning messages pop up? Can you provide a screenshot?

Re: Disabling NX warning message(s) to run a macro-How to?

Phenom
Phenom

cowski1,

 

The error msg pops-up when creates the AFU Record. I tought I put the line

     theUISession.UserInterfacePreferences.DisplayAlertsOnWarnings = False

in the wrong place but to no avail.

 

I defined the UI sessin as follows;

   Public Dim theUISession As UI = UI.GetUI

 

Thanks

 

Regards

 

JXB

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

Re: Disabling NX warning message(s) to run a macro-How to?

Esteemed Contributor
Esteemed Contributor

This is a regular message box not an alert box, which is the small window in the lower right hand corner of the graphics window.

 

I don't think you can turn that off through the API, but you may be able to do so in the prferences for journaling, if this is run as a journal.

If this is run as dll there might be other options in the API.

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: NX11.0 EAP, NX12.0 EAP

How to Get the Most from Your Signature in the Community

Re: Disabling NX warning message(s) to run a macro-How to?

Phenom
Phenom

Thanks for that Stefan. A bit annyoing if I cannot disable this warning. For testing of the macro The message pops-up 3 times (1 element  x 3 results processed) so it doesn't bother me too much but ideally the macro should (will!) be able to handle a "large" mumber of elements (x3 results). So having the user sitting at his desk clicking OK all the time is a bit pointless (when I was hoping one could go for a coffee while the macro process the data!)

 

I have't looked at .dll option yet as I believe I do not have the "signature licence" required. but it definitly something I need to look at to deploy the macros (once I have found a good ste-by-step document describing how to do it!)

 

Will see directly with Siemens Tech support if there is a an option/way of doing it

 

Thanks

 

Regards

 

JXB

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

Re: Disabling NX warning message(s) to run a macro-How to?

Esteemed Contributor
Esteemed Contributor

BTW, don't confuse journals or better VB.NET scripts with macros in NX.

 

Macros are a much older ability than journals and are known to need changes with every change of a dialog it recorded in NX.

 

A macro is only valid for one NX release, even only for one MR/MP, if the dialog it recorded changed.

 

A journal or vb.net script is often valid for multiple NX releases.

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: NX11.0 EAP, NX12.0 EAP

How to Get the Most from Your Signature in the Community

Re: Disabling NX warning message(s) to run a macro-How to?

Phenom
Phenom

Hi Stefan.

 

You are quite right. I used the word 'macro" a bit loosely to describe my problem. I am writing a vb script

 

Regards

 

JXB

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

Re: Disabling NX warning message(s) to run a macro-How to?

Phenom
Phenom

To all

 

From an official source on my query. I quote verbatim

$---------------

The DisplayAlertsOnWarnings property only pertains to Modeling features:

   “Returns or sets the option "Display Alerts on Warnings" gives choice, whether the user wants the Diagnostic alerts appear when features contain warnings during feature creation, edit, and update.”

 

There is no way to globally suppress warnings like the ones shown in the image. I have been told that the intent is that these should not be displayed while a journal/.dll is executing. If they are, that it is because a developer implemented the warning outside of the standard framework. Examples such as this should be PR’d so that the warning dialog will not be displayed during NX Open execution.

$---------------

 

Regards

 

JXB

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