Macro — Powermill
// Stop on un-recoverable errors MACRO ABORT ON // Clear the session (Optional: Use with caution) DELETE TOOLPATH ALL DELETE TOOL ALL DELETE MODEL ALL Hard-coded macros are brittle. Use INPUT or QUERY to ask the user for variables.
STRING tool_diameter = INPUT "Enter Tool Diameter" STRING stock_height = INPUT "Enter Stock Z Height" Now, execute the commands using the variables. powermill macro
STRING answer = QUERY "Do you want to use High Speed Machining? (Yes/No)" IF answer == "Yes" EDIT TOOLPATH "Finishing" HSM ON EDIT TOOLPATH "Finishing" CORNER_SPEED 75 ELSE EDIT TOOLPATH "Finishing" HSM OFF ENDIF This is the ultimate time saver. Instead of writing the same line for 50 tools, you loop through all entities. // Stop on un-recoverable errors MACRO ABORT ON
CREATE TOOL "Endmill" dia $tool_diameter // The $ recalls the variable ACTIVATE TOOL "Endmill" CREATE STOCK BOX EDIT STOCK BOX LIMITS -10 -10 0 10 10 $stock_height STRING answer = QUERY "Do you want to
This is where the comes into play.
Start small. Record a parameter trace of you changing a tool speed. Save that as a macro. Next, add a loop. Soon, you will have a library that transforms a 4-hour programming job into a 20-minute verification session.
// Select the model named "Block" SELECT MODEL "Block" // Create a new toolpath CREATE TOOLPATH "Roughing" ACTIVATE TOOLPATH "Roughing"