Message 1 of 2

Not applicable
03-29-2021
12:23 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I swear I had this working last week... I'm calling tool.getShaftDiameter() as it's listed as a function of the tool class (reference : https://cam.autodesk.com/posts/reference/classTool.html#a5e2acd5a77b4b8808f0428f788542b3c), but I get the error:
Error: TypeError: tool.getShaftDiameter is not a function
Error at line: 551
Code below, I've marked line 551
var tools = getToolTable();
if (tools.getNumberOfTools() > 0) {
var diaFormat = createFormat({decimals:4, trim:false});
var twodecFormat = createFormat({decimals:2});
for (var i = 0; i < tools.getNumberOfTools(); ++i) {
var tool = tools.getTool(i);
var comment = "T" + toolFormat.format(tool.number) + " - ";
comment+= "D" + tool.diameterOffset + " - ";
comment+= "H" + tool.lengthOffset + " - ";
comment+= "DIA=" + diaFormat.format(tool.diameter) + " - ";
comment+= "FLENGTH=" + twodecFormat.format(tool.getFluteLength());
if ( tool.getShaftDiameter() != tool.diameter) { //line 551
comment += " - " + "RL=" + twodecFormat.format(tool.getShoulderLength());
}
I know newer implementations of java do weird things with getters and setters but unless something vastly changed from just a few days ago, I think this should work... Any help is appreciated. Thank you!
Solved! Go to Solution.