Message 1 of 2
Multi Line Output
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
The following code outputs tool information
var tools = getToolTable();
if (tools.getNumberOfTools() > 0) {
for (var i = 0; i < tools.getNumberOfTools(); ++i) {
var tool = tools.getTool(i);
var comment = "T" + toolFormat.format(tool.number) + " " +
"D=" + xyzFormat.format(tool.diameter) + " " +
localize("CR") + "=" + xyzFormat.format(tool.cornerRadius);
if ((tool.taperAngle > 0) && (tool.taperAngle < Math.PI)) {
comment += " " + localize("TAPER") + "=" + taperFormat.format(tool.taperAngle) + localize("deg");
}
if (zRanges[tool.number]) {
comment += " - " + localize("ZMIN") + "=" + xyzFormat.format(zRanges[tool.number].getMinimum());
}
comment += " - " + getToolTypeName(tool.type);
writeComment(comment);
}
}
Like this
(T1 D=2.5 CR=0.125 - BULLNOSE END MILL)
(T2 D=0.625 CR=0.125 - BULLNOSE END MILL)
(T5 D=0.5 CR=0.25 - BALL END MILL)
(T8 D=0.25 CR=0. - FLAT END MILL)
(T12 D=0.2656 CR=0. TAPER=118DEG - DRILL)
(T13 D=0.375 CR=0. TAPER=120DEG - SPOT DRILL)
(T15 D=0.75 CR=0. - FLAT END MILL)
(T16 D=0.375 CR=0. - FLAT END MILL)
(T17 D=0.06 CR=0.062 - RADIUS MILL)
(T22 D=0.269 CR=0. - REAMER)
How can I break up each tools information to its own line? Like this
(T1)
(D=2.5)
(CR=0.125)
(BULLNOSE END MILL)
How can I add a "new line" to each "comment"?