run a macro for every toolpath and boundary

run a macro for every toolpath and boundary

GlennM.MCAM
Collaborator Collaborator
1,153 Views
5 Replies
Message 1 of 6

run a macro for every toolpath and boundary

GlennM.MCAM
Collaborator
Collaborator

Hello,

 

How can I make a macro that runs a macro for every toolpath and every boundary?

 

I want to step up my game for automating my electrode programming (changing spark gap automaticly by a predefined value).

 

If this isn't possible, how can I make a variable for every toolpath name? Note that the amount of toolpath my vary.

 

Thanks,

Glenn


Intel i7 4790 @ 3.60GHz -16GB RAM - Nvidia Quadro K620 - 250GB SSD - Win 7 Pro x64 SP1
PowerMILL Premium 2019.1 - PowerINSPECT Ultimate OMV 2017 SP6
0 Likes
Accepted solutions (1)
1,154 Views
5 Replies
Replies (5)
Message 2 of 6

kukelyk
Advisor
Advisor

Try something like this:

FOREACH tp IN FOLDER('toolpath') {
	FOREACH b IN FOLDER('boundary')	{
		ACTIVATE TOOLPATH $tp.name
		EDIT TOOLPATH ; CLONE
		ACTIVATE BOUNDARY $b.name
		EDIT TOOLPATH ; CALCULATE
	}
}
Message 3 of 6

kukelyk
Advisor
Advisor
Accepted solution

or something like this:

FOREACH tp IN FOLDER('toolpath') {
	ACTIVATE TOOLPATH $tp.name
	MACRO "toolpathmacro.mac"
	
}
FOREACH b IN FOLDER('boundary')	{
	ACTIVATE BOUNDARY $b.name
	MACRO "boundarymacro.mac"
}
0 Likes
Message 4 of 6

GlennM.MCAM
Collaborator
Collaborator

Thanks @kukelyk !


Intel i7 4790 @ 3.60GHz -16GB RAM - Nvidia Quadro K620 - 250GB SSD - Win 7 Pro x64 SP1
PowerMILL Premium 2019.1 - PowerINSPECT Ultimate OMV 2017 SP6
0 Likes
Message 5 of 6

GlennM.MCAM
Collaborator
Collaborator

How can I check if a boundary is active or the toolpath even has a boundary?

 

I tried something like this but doesn't work because that variable is incorrect

IF $b.active {
MESSAGE INFO "boundary is active"
}

 

Thanks,

Glenn


Intel i7 4790 @ 3.60GHz -16GB RAM - Nvidia Quadro K620 - 250GB SSD - Win 7 Pro x64 SP1
PowerMILL Premium 2019.1 - PowerINSPECT Ultimate OMV 2017 SP6
0 Likes
Message 6 of 6

GlennM.MCAM
Collaborator
Collaborator

Nevermind, found a solution

 

IF entity_exists(entity('boundary','')) {
MESSAGE INFO "active boundary"
} ELSE {
MESSAGE INFO "no active boundary"
}

Intel i7 4790 @ 3.60GHz -16GB RAM - Nvidia Quadro K620 - 250GB SSD - Win 7 Pro x64 SP1
PowerMILL Premium 2019.1 - PowerINSPECT Ultimate OMV 2017 SP6
0 Likes