PowerMill Forum
Welcome to Autodesk’s PowerMill Forums. Share your knowledge, ask questions, and explore popular PowerMill topics.

PowerMill Forum

Reply
Highlighted
Advocate hx
Post 1 of 5

PowerMILL 2017 Dialogs On\Off error when run macro.

191 Views, 4 Replies
11-20-2016 10:21 PM

In PowerMILL 2017 SP2. I record two macro "Dialogs On.mac" and "Dialogs Off.mac".

 

The command are:

 

1.Dialogs On.mac

 

DIALOGS MESSAGE ON
DIALOGS ERROR ON

 

2.Dialogs Off.mac

 

DIALOGS MESSAGE OFF
DIALOGS ERROR OFF

 

Dialogs On Off Error.png

 

When I use the comands in command windows, these problem is not display.

Post 2 of 5

Re: PowerMILL 2017 Dialogs On\Off error when run macro.

01-04-2017 12:32 PM in reply to: hx

I'm having the same problem.  DIALOGS MESSAGE OFF / ON and DIALOGS ERROR OFF / ON do not work when used in a macro.  They do work if typed in the command window though. Any update on when this will be fixed?  I've updated to SP3 and still have the issue.

Post 3 of 5

Re: PowerMILL 2017 Dialogs On\Off error when run macro.

01-04-2017 02:03 PM in reply to: rmiller

When a macro starts the state of the warning, message, and graphic lock is recorded. When the macro ends the previous state is restored. This is so an early return from the macro or a macro error that cause the macro to end unexpectedly does not leave powermill in a state where the graphics, or messages do not appear to be working. A special case is if you set these values in one of the start up macros (pmlocal, pmuser) where the restoration is not performed.

 

The behaviour is as designed.

 

Post 4 of 5

Re: PowerMILL 2017 Dialogs On\Off error when run macro.

01-04-2017 02:16 PM in reply to: urizenYHS3W

Note you can put the commands into a FUNCTION:

FUNCTION DialogsON() {
  DIALOGS MESSAGE ON
  DIALOGS ERROR ON
}

FUNCTION DialogsOFF() {
  DIALOGS MESSAGE OFF
  DIALOGS ERROR OFF
}

put these into your file of useful functions "MyFunctions.inc" and include them other macros you write:

 

FUNCTION Main() {
  // Don't want dialogs at the moment
  CALL DialogsOFF()
  // Do a lot of stuff
  // Now want the dialogs to display
  CALL DialogsON()
   // do a bunch of orher stuff
   // don't want dialogs anymore
   CALL DialogsOFF()
   // a load more stuff
}

INCLUDE "MyFunctions.inc"
Post 5 of 5

Re: PowerMILL 2017 Dialogs On\Off error when run macro.

01-05-2017 05:22 AM in reply to: urizenYHS3W

You are correct that the state is locked and that is how it is supposed to work.  So, if the state is ON when my macro starts  and my macro has the following

 

DIALOGS MESSAGE OFF
DIALOGS ERROR OFF

 

Do some stuff

 

DIALOGS MESSAGE ON
DIALOGS ERROR ON

 

Then the messages and errors should be OFF during my macro and turned back ON after my macro runs.  And if my macro stops in between they will be turned ON because of the previous state.  That is how it works in 2016 however in 2017 I get the messages and errors popping up while my macro is running.

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post