Community
PowerMill Forum
Welcome to Autodesk’s PowerMill Forums. Share your knowledge, ask questions, and explore popular PowerMill topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

PowerMILL 2017 Dialogs On\Off error when run macro.

4 REPLIES 4
Reply
Message 1 of 5
hx
Advocate
1098 Views, 4 Replies

PowerMILL 2017 Dialogs On\Off error when run macro.

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.

4 REPLIES 4
Message 2 of 5
rmiller
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.

Message 3 of 5
urizenYHS3W
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.

 

Message 4 of 5
urizenYHS3W
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"
Message 5 of 5
rmiller
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.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report