Das Beispiel demonstriert, wie Sie ein Makro mit einem benutzerdefinierten Sicherheitsabstand erstellen, um die ausgewählten Werkzeugwege auf Kollisionen zu prüfen. Im Zusammenhang mit dem Makro geschieht Folgendes:
Function Main(
STRING $Selected_Toolpath
)
{
// Create new project parameter to store the holder clearance
BOOL $chk = 0
$chk = ERROR $project.clearance
if $chk {
// Project variable does not exist. Create it and set it to 5 degrees
EDIT PAR CREATE REAL "clearance"
}
// Before checking the first toolpath, PowerMILL should ask the user to enter the holder clearance
IF($powermill.Status.MultipleSelection.First) OR $powermill.Status.MultipleSelection.Total == 0 {
$project.clearance = INPUT ${"Enter the holder clearance PowerMILL uses when checking the " + $powermill.Status.MultipleSelection.Total + " selected toolpaths for collisions "}
}
// Now collision check toolpath with entered clearance
// Set the clearance:
EDIT COLLISION HOLDER_CLEARANCE $project.clearance
// Now check the toolpath for collisions
EDIT COLLISION TYPE COLLISION
PRINT = "Processing toolpath " + $powermill.Status.MultipleSelection.Count
EDIT COLLISION APPLY
// Tell user all selected toolpaths have been checked
IF ($powermill.Status.MultipleSelection.Last) {
MESSAGE INFO "All toolpaths have been checked "
}
}
Geben Sie alle Zeilen ohne Zeilenumbrüche ein. Aufgrund der begrenzten Seitenbreite sieht es in diesem Fall möglicherweise so aus, als würden einige Zeilen Zeilenumbrüche enthalten.