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: 

help with rest boundary macro

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
jsweatherbie
428 Views, 2 Replies

help with rest boundary macro

Hello everyone im a bit stumped on this and need some extra assistance ...

im trying to make a rest macro. the rest macro lets you choose your tools and then it will make the first cutter in the list the tool and the 2nd tool in the list is the ref tool. 

and then from there itll make another rest but with the ref tool from the first rest boundary as the tool. then it will continue untill it goes thru the list of selected tool.... 

my code i have so far.............................

reset localvars

//CHECKS IF THERES TOOLS IN SESSION
IF NOT ENTITY_EXISTS($entity('tool')) {
message info "No tools imported ! ! !"
return
}

//USER SELECTS THE TOOLS TO BE USED IN REST BOUNDARY
ENTITY list userSelected = INPUT ENTITY MULTIPLE TOOL "Select tools to rest boundry"

do while true { 

foreach i IN $userSelected { 
CREATE BOUNDARY ; REST3D FORM BOUNDARY
EDIT BOUNDARY ; TOOL NAME $i.Name

string lastTool = $i.Name
int a = remove_last($userSelected, i.Name)
EDIT BOUNDARY ; REFTOOL NAME $i.Name
EDIT BOUNDARY ; CALCULATE

}
}
2 REPLIES 2
Message 2 of 3
icse
in reply to: jsweatherbie

Good idea for a macro

I'll added some stuff feel free to remove what you dont like:

 

entity list $tools = filter(explorer_selected_entities(),'this.RootType == "tool"')

if size($tools) < 2 {
	return
}


real $find = input 'find thicker than'
real $ext = input 'Extend'
real $tol = input 'Tolerance'
real $thick = input 'Thickness'

int $i = 0 
while $i + 1 < size($tools) {
	
	string $t = $tools[$i + 1].Name
	string $tRef = $tools[$i].Name
	string $boundName = $t + '__Ref:' + $tRef + '_Thick:' + $thick
	
	if $entity_exists('boundary', $boundName) {
		$boundName = new_entity_name('boundary', $boundName)
	}
	
	CREATE BOUNDARY ${boundName} REST3D
	
	EDIT BOUNDARY ${boundName} THICKER ${find}
	
	EDIT BOUNDARY ${boundName} EXTEND ${ext}
	
	EDIT BOUNDARY ${boundName} TOLERANCE ${tol}
	
	EDIT BOUNDARY ${boundName} THICKNESS ${thick}
	
	EDIT BOUNDARY ${boundName} TOOL NAME ${t}
	
	EDIT BOUNDARY ${boundName} REFTOOL NAME ${tRef}
	EDIT BOUNDARY ${boundName} CALCULATE	
	$i = $i + 1
}

 

Message 3 of 3
TK.421
in reply to: jsweatherbie

this is the macro i use for my corner finishing. feel free to rip from it what you want! the macro operates thusly: i select all of the main finishing programs that need to have a corner toolpath run after them, and then i execute the macro. it goes through and copies the workplane, boundary and block for each toolpath created

--------------------------------------
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

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

Post to forums  

Autodesk Design & Make Report