Message 1 of 4
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I've got a macro that will calculate the holder profile for all tools being used. The issue I have is when I add a line of code auto adjust the overhang based on the holder profile. It works just fine, until it comes across a locked tools. So I have been trying to get something to detect that the tool is locked, and if so, not calculate the overhang.
I have used ERROR DOCOMMAND in the past to catch things like this, but I can't seem to get the syntax right for DOCOMMAND to work properly. I am using powermill 2015
Here's what I have, any ideas would be appreciated:
ENTITY LIST usedTools = {}
$usedTools = extract(folder('toolpath'), 'tool')
INT Duplicates = 0
$Duplicates = remove_duplicates($usedTools)
FOREACH tool IN $usedTools {
EDIT TOOL $tool PROFILE_INCLUDE_ALL
EDIT TOOL $tool UPDATE_TOOLPATHS_PROFILE
BOOL error = 0
STRING toolName = $tool.name
STRING cmd = "EDIT TOOL" + $toolName + "AUTO_OVERHANG"
$error = ERROR DOCOMMAND $cmd
IF NOT $error {
EDIT TOOL $toolName AUTO_OVERHANG
}
}
Solved! Go to Solution.