macro to generate

Ibisu_nert
Participant
Participant

macro to generate

Ibisu_nert
Participant
Participant

hello, in my company we work with different parts such as caps, cavities and electrodes. We generate them in two post-processors, such as litz and fanuc.

example of generated folders

FANUC
h:\Cavities\cavity_37

LITZ
l:\Cavities\cavity\37

 

My question is: is there a macro that generates in both places with a different processed post specific for each path, fanuc H: and Litz L:, respecting the Path I put:

for example I put L:\cavities\cavity_37\Tombamentos

the same macro generates and then changes the pos to Fanuc and generates in

H:\cavidades\cavidade_37\Tombamento

0 Likes
Reply
918 Views
9 Replies
Replies (9)

TK.421
Advisor
Advisor

here's a macro i wrote some time ago that does the same thing. you'll need to change the folder structure and post names of course.

--------------------------------------
Former Expert Elite Member (not enough participation in all their webinars and other "stuff", even though I beta test and regularly contribute to the betterment of the software and the PowerMill community as a whole)

the numbers never lie
0 Likes

Ibisu_nert
Participant
Participant

I changed the processor folders but it didn't work for me

0 Likes

TK.421
Advisor
Advisor

can you be a little more specific with the errors? 

--------------------------------------
Former Expert Elite Member (not enough participation in all their webinars and other "stuff", even though I beta test and regularly contribute to the betterment of the software and the PowerMill community as a whole)

the numbers never lie
0 Likes

Carlos.PintoLRW5G
Enthusiast
Enthusiast

Hi @Ibisu_nert   try this macro. Need to change paths !

 

 

// generate for 2 machines

EDIT NCPROGRAM ALL MESSAGES OFF
EDIT NCPROGRAM ALL COMMANDS BEFORE
EDIT NCPROGRAM ALL COMMANDS "/ {setupsheets.model.file_name}"
TPCOMMANDS ACCEPT

FOREACH ncprogram IN folder('NCProgram') {
ACTIVATE NCPROGRAM $ncprogram.Name
//machine 1
EDIT NCPROGRAM $ncprogram.Name FILENAME "D:\BLOCK\{ncprogram}s.mpf" //your destination folder
EDIT NCPROGRAM $ncprogram.Name TAPEOPTIONS FILEOPEN
"C:\FREZITE\Madeira\Centro de Maquinagem\PowerMILL\ductpost\2024\frezite_CBF-A-SIEMENS-TACV-AB_A8 2024.02.08.pmoptz" //your post 1
NCTOOLPATH APPLY
ACTIVATE NCPROGRAM $ncprogram.Name KEEP NCPROGRAM ; YES

//machine 2
EDIT NCPROGRAM $ncprogram.Name FILENAME "D:\BLOCK\{ncprogram}.tap"
EDIT NCPROGRAM $ncprogram.Name TAPEOPTIONS FILEOPEN
"C:\FREZITE\Madeira\Centro de Maquinagem\PowerMILL\ductpost\2024\Ferrari AUT12-Elexa-9 2024.01.19.pmoptz" //your post 2
NCTOOLPATH APPLY
ACTIVATE NCPROGRAM $ncprogram.Name KEEP NCPROGRAM ; YES
}
TEXTINFO ACCEPT
message info "Pronto!"
// TERMINADO

0 Likes

Ibisu_nert
Participant
Participant

YOU PT_BR?

0 Likes

Carlos.PintoLRW5G
Enthusiast
Enthusiast
PT
0 Likes

Ibisu_nert
Participant
Participant

does not execute. When debugging nothing happens, my powermil is 2020
maybe for this
0 Likes

TK.421
Advisor
Advisor

did you change the extension from .txt to .mac? the debugger should show you errors

--------------------------------------
Former Expert Elite Member (not enough participation in all their webinars and other "stuff", even though I beta test and regularly contribute to the betterment of the software and the PowerMill community as a whole)

the numbers never lie
0 Likes

Carlos.PintoLRW5G
Enthusiast
Enthusiast
Did you change the paths and post files?
0 Likes