I've made the edits to the post, which is attached. You can download the post and use it, or review the following info and make the changes yourself. Either way, make sure you aren't modifying and saving the generic to the Generic Post folder. Next update it will be wiped out and replaced with the stock generic post. You will want to perform a "Save As" and save it into a folder independent of Fusion, or save it to the cloud when you are happy with the changes
Search for this line:
// retract to safe plane
retracted = true;
if (properties.format == 1) {
writeBlock(gAbsIncModal.format(90), gMotionModal.format(0), hFormat.format(0), "Z" + xyzFormat.format(0)); // retract
} else {
writeBlock(gFormat.format(28), gAbsIncModal.format(91), "Z" + xyzFormat.format(0)); // retract
// writeBlock(gFormat.format(28)); // retract
}
zOutput.reset();
And insert a line to make it now read this: (inserted line is in red)
// retract to safe plane
retracted = true;
if (properties.format == 1) {
writeBlock(gAbsIncModal.format(90), gMotionModal.format(0), hFormat.format(0), "Z" + xyzFormat.format(0)); // retract
} else {
writeBlock(gFormat.format(28), gAbsIncModal.format(91), "Z" + xyzFormat.format(4.)); // retract
writeBlock(gMotionModal.format(0), gAbsIncModal.format(90), "X" + xyzFormat.format(-19.),"Y" + xyzFormat.format(9.));
// writeBlock(gFormat.format(28)); // retract
}
zOutput.reset();
}
Next we want to find the tool change section:
writeBlock("T" + toolFormat.format(tool.number), mFormat.format(6));
if (tool.comment) {
writeComment(tool.comment);
}
var showToolZMin = false;
if (showToolZMin) {
if (is3D()) {
var numberOfSections = getNumberOfSections();
var zRange = currentSection.getGlobalZRange();
var number = tool.number;
for (var i = currentSection.getId() + 1; i < numberOfSections; ++i) {
var section = getSection(i);
if (section.getTool().number != number) {
break;
}
zRange.expandToRange(section.getGlobalZRange());
}
writeComment(localize("ZMIN") + "=" + zRange.getMinimum());
}
}
And tack on this snippet of code after all of it, so it looks like this (again, added line is in red
writeBlock("T" + toolFormat.format(tool.number), mFormat.format(6));
if (tool.comment) {
writeComment(tool.comment);
}
var showToolZMin = false;
if (showToolZMin) {
if (is3D()) {
var numberOfSections = getNumberOfSections();
var zRange = currentSection.getGlobalZRange();
var number = tool.number;
for (var i = currentSection.getId() + 1; i < numberOfSections; ++i) {
var section = getSection(i);
if (section.getTool().number != number) {
break;
}
zRange.expandToRange(section.getGlobalZRange());
}
writeComment(localize("ZMIN") + "=" + zRange.getMinimum());
}
}
writeBlock(gFormat.format(28), gAbsIncModal.format(91), "Z" + xyzFormat.format(4.)); // retract
I'd prefer to set this up as a user property that you can toggle between the two methods. I'll mess around with that as time allows during the weekend.
Seth Madore
Owner, Liberty Machine, Inc.
Good. Fast. Cheap. Pick two.