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
}
}
Solved! Go to Solution.
Solved by TK.421. Go to Solution.
Solved by icse. Go to Solution.
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
}
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
Can't find what you're looking for? Ask the community or share your knowledge.