Message 1 of 4
Sort toolpaths by workplane position or boundary
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
So I have a macro that I use to split up a toolpath folder of drilling paths using the active boundary and keeps both paths. Is there a way to sort the resulting paths into separate folders, depending on if they were inside or outside of the boundary? Also, I'm using powermill 2015.
GRAPHICS LOCK
DIALOGS MESSAGE OFF
STRING activeBoundary = ""
IF ENTITY_EXISTS(ENTITY('BOUNDARY', '')) {
$activeBoundary = ENTITY('BOUNDARY', '').Name
} ELSE {
MACRO PAUSE "Activate a boundary!"
}
STRING fld = active_folder()
IF POSITION($fld, "Toolpath") == -1 {
GRAPHICS UNLOCK
MACRO PAUSE "Please activate a toolpath folder"
GRAPHICS LOCK
$fld = active_folder()
}
FOREACH tp IN folder($fld){
ACTIVATE TOOLPATH $tp.name
EDIT TOOLPATH LIMIT BOUNDARY
EDIT TOOLPATH LIMIT BOUNDARYNAME $activeBoundary
EDIT TOOLPATH LIMIT DELETE Y
EDIT TOOLPATH LIMIT BOUNDPLANEOPTIONS ACTIVE_WORKPLANE
EDIT TOOLPATH LIMIT KEEP BOTH
PROCESS TPLIMIT
}
GRAPHICS UNLOCK
DIALOGS MESSAGE ON
If I can't use the boundary itself, using the workplane coordinates to sort them would be the next best option. Since most of the toolpaths I am splitting are drilling toolpaths, I can't use boundaries while calculating them either. Any thoughts?