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: 

Macro Request

28 REPLIES 28
Reply
Message 1 of 29
Anonymous
4155 Views, 28 Replies

Macro Request

You guys are so good at Macros, maybe you can help me with these two.

 

1) I would like to be able to invalidate all toolpaths, then calculate them all. 

I have tried "queuing", but that takes forever. I just want everything calculated without having to click 90 times.

 

2) Gouge check and collision check for all toolpaths. (no split toolpath, 0.0 verification thickness, calculate collision depth, but do not adjust tool)

I use automatic verification on new programs, but we have a lot of old programs where automatic verification was not used.

28 REPLIES 28
Message 21 of 29

Could you explain this bit more,I tried using the macro and it it says variable missing

Message 22 of 29
icse
in reply to: anto_joseph4HH2K

If you post your macro i can take a look at it

Message 23 of 29
anto_joseph4HH2K
in reply to: Anonymous

There you go

Message 24 of 29
icse
in reply to: anto_joseph4HH2K

I think the problem was that you did not start the macro from the toolpath context menue...

 

try running this maco:

//gets all the toolpaths that are selected in the explorer wich are computed and not empty
entity list $tps = filter(explorer_selected_entities(),'this.RootType == "toolpath" and this.Computed and segments(this) > 0')

//if nothing was selected we exit the macro here
if size($tps) < 1 {
	return
}

dialogs message off

//iterate over all selected toolpaths with the foreach loop
foreach $tp in $tps {

	// activate the next toolpath
	ACTIVATE TOOLPATH ${tp.Name}
	
	//set the parameter for collision check
	EDIT COLLISION TYPE GOUGE
	EDIT COLLISION APPLY
	EDIT COLLISION TYPE COLLISION
	EDIT COLLISION STOCKMODEL_CHECK N
	EDIT COLLISION SPLIT_TOOLPATH N
	EDIT PAR 'Verification.UseVerificationThickness' 0
	EDIT COLLISION SHANK_CLEARANCE "0.0"
	EDIT COLLISION HOLDER_CLEARANCE "0.1"
	EDIT COLLISION ADJUST_TOOL N
	EDIT COLLISION APPLY
}

dialogs message on

 

this runs a collision check over all selected toolpaths selected in the explorer

 

Message 25 of 29
anto_joseph4HH2K
in reply to: Anonymous

Its not working it shows the following error message

Capture.JPG

 Not sure if am missing any plugin or files asociated with the powermill application in order to run the macros

 

Message 26 of 29
icse
in reply to: anto_joseph4HH2K

wich PM version do you use?

 

you could try this:


entity list $tps = explorer_selected_entities()

//if nothing was selected we exit the macro here
if size($tps) < 1 {
	return
}

dialogs message off

//iterate over all selected toolpaths with the foreach loop
foreach $tp in $tps {

	// activate the next toolpath
	ACTIVATE TOOLPATH ${tp.Name}
	
	//set the parameter for collision check
	EDIT COLLISION TYPE GOUGE
	EDIT COLLISION APPLY
	EDIT COLLISION TYPE COLLISION
	EDIT COLLISION STOCKMODEL_CHECK N
	EDIT COLLISION SPLIT_TOOLPATH N
	EDIT PAR 'Verification.UseVerificationThickness' 0
	EDIT COLLISION SHANK_CLEARANCE "0.0"
	EDIT COLLISION HOLDER_CLEARANCE "0.1"
	EDIT COLLISION ADJUST_TOOL N
	EDIT COLLISION APPLY
}

dialogs message on
Message 27 of 29
anto_joseph4HH2K
in reply to: Anonymous

Still not working,I use 2022 version

Message 28 of 29
icse
in reply to: anto_joseph4HH2K

how do you run the macro?

Message 29 of 29
anto_joseph4HH2K
in reply to: Anonymous

Capture.JPG

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

Post to forums  

Autodesk Design & Make Report