Community
HSM Post Processor Forum
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Post Tool as tool description

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
mario.kaiserXZ5XS
281 Views, 2 Replies

Post Tool as tool description

Hello together,

 

i want to have in the ost the tool description not the tool number.  I have tried several things but it is not working. perhaps somebody can help me with this. Here is the code what i have tried

 

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) + " " +
(tool.diameter != 0 ? "D=" + spatialFormat.format(tool.diameter) + " " : "") +
(tool.isTurningTool() ? localize("NR") + "=" + spatialFormat.format(tool.noseRadius) : localize("CR") + "=" + spatialFormat.format(tool.cornerRadius)) +
(tool.taperAngle > 0 && (tool.taperAngle < Math.PI) ? " " + localize("TAPER") + "=" + taperFormat.format(tool.taperAngle) + localize("deg") : "") +
(zRanges[tool.number] ? " - " + localize("ZMIN") + "=" + spatialFormat.format(zRanges[tool.number].getMinimum()) : "") +
" - " + localize(getToolTypeName(tool.type)) +
" - " + tool.description();
writeComment(comment); }

 

Thanks for the help!

2 REPLIES 2
Message 2 of 3
Arun.rs
in reply to: mario.kaiserXZ5XS

HI @mario.kaiserXZ5XS 

 

Try below code and let me know the feedback.

 

    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);
        comment += " - " + tool.description;
        writeComment(comment);
      }
    }

Regards



Arun.RS
Technical Consultant - Post Processor
Message 3 of 3
mario.kaiserXZ5XS
in reply to: Arun.rs

Hello Arun,

 

thanks for this info your code is working!

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report