help needed for a macro

help needed for a macro

benettitec01
Enthusiast Enthusiast
356 Views
2 Replies
Message 1 of 3

help needed for a macro

benettitec01
Enthusiast
Enthusiast

hello

I have this macro that let me choose wich toolpaths It reverses the machine head. unfortunatelly the update time is sometime too high so I decided I had to input a macro pause. 

But so that I have to look at the process , wait for the updating, and lately confirm the macro pause to go forward.

Is there someone that can help me to avoid to manually confirm for each toolpath? I don't know how to make the macro consider the update time.

 

Here is my macro, and thank you for helping

 

entity list $tps = input entity multiple toolpath 'SELEZIONA PERCORSI'

Dialogs message off
foreach $tp in $tps {

EXPLORER SELECT Toolpath "$tp.Name" NEW
ACTIVATE TOOLPATH $tp.name
FORM RIBBON TAB "MachineTool"
MODE TOOLCONTROLPAD START
MODE TOOLCONTROLPAD FLIPORIENTATION

 

STRING Msg = "riavvia se ha aggiornato"
MODE TOOLCONTROLPAD UPDATETOOLPATH
MACRO PAUSE $Msg

 

MODE TOOLCONTROLPAD ACCEPT
FORM RIBBON TAB "MachineTool"
FORM RIBBON TAB "Home"
TEXTINFO ACCEPT
DEACTIVATE Toolpath

}
Dialogs message on

 

 

 

 

Greetings

0 Likes
357 Views
2 Replies
Replies (2)
Message 2 of 3

benettitec01
Enthusiast
Enthusiast

UNLUKILY I don't understand why, also using macro pause, the macro only flips the axis orientation.

sometime rotate 180 degrees, sometime flips 360 degrees.

 

here is my macro again: because when I mirror I can't flip manually all the toolpaths!!!

 

entity list $tps = input entity multiple toolpath 'SELEZIONA PERCORSI'
 
Dialogs message off
foreach $tp in $tps {
 
STRING Msg = "riavvia se ha aggiornato" 
 
EXPLORER SELECT Toolpath "$tp.Name" NEW
ACTIVATE TOOLPATH $tp.name
FORM RIBBON TAB "MachineTool"
MODE TOOLCONTROLPAD START
MODE TOOLCONTROLPAD FLIPORIENTATION
 
 
MODE TOOLCONTROLPAD UPDATETOOLPATH
 
 
 
MODE TOOLCONTROLPAD ACCEPT
 
FORM RIBBON TAB "MachineTool"
FORM RIBBON TAB "Home"
 
 
   MACRO PAUSE $Msg
 
}
Dialogs message on
 
 
 
well...... thanks to the solver, if.
 
greetings
 
danny

 

0 Likes
Message 3 of 3

rafael.sansao
Advisor
Advisor

Você pode responder algo assim no fórum:


Hi,

I updated your macro slightly to make it a bit cleaner and avoid some unnecessary overhead. However, macros that interact with the Tool Control Pad and force a toolpath update are inherently slow in Powermill, because each toolpath must be recalculated after the orientation change.

So unfortunately you will probably not get a much faster result than this when using a macro.

 

Here is the updated version:

ENTITY LIST $tps = input entity multiple toolpath 'SELEZIONA PERCORSI'

DIALOGS MESSAGE OFF
GRAPHICS LOCK
FOREACH $tp IN $tps {
	ACTIVATE TOOLPATH $tp.name
	SIMULATE TOOLPATH $tp.name
	MODE TOOLCONTROLPAD START
	MODE TOOLCONTROLPAD FLIPORIENTATION
	MODE TOOLCONTROLPAD UPDATETOOLPATH
	MODE TOOLCONTROLPAD ACCEPT
	TEXTINFO ACCEPT
	DEACTIVATE Toolpath
}
GRAPHICS UNLOCK
DIALOGS MESSAGE ON

This should behave the same as your original macro but with slightly cleaner execution. However, since each toolpath still needs to be recalculated, the execution time will mainly depend on the number and complexity of the toolpaths.

 

Unfortunately, macros do not have a faster internal way to flip the orientation of multiple toolpaths.

Hope this helps.

Rafael Sansão

OptiNC - www.optinc.tech

EESignature

0 Likes