Fusion 360 CAM Post : Add Max Tool Depth per Operation of same tool.

Fusion 360 CAM Post : Add Max Tool Depth per Operation of same tool.

GermanWings
Advocate Advocate
487 Views
4 Replies
Message 1 of 5

Fusion 360 CAM Post : Add Max Tool Depth per Operation of same tool.

GermanWings
Advocate
Advocate

Hello, I am starting to modify Fusion Post of my Haas VF , I do see there is ability to add Max Z Depth of a Tool in the NC Program. But I tend to use Same tool for a lot of operations. Can I add Max Tool Depth Value particular to that operation at the start of that operation. So if T1 does a chamfer of 3mm Depth , and then a pocket of 5mm Depth. In the Chamfer Section of NC Program Z Minus will be 3mm as comment at start of the operation. And Z Minus as 5mm at start of the Pocket Section ?

0 Likes
488 Views
4 Replies
  • CAM
Replies (4)
Message 2 of 5

Steinwerks
Mentor
Mentor

I believe this is already set up in many of the posts. In the Fanuc post for example on line 1378 there is this section:

 

    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());
      }
    }

If you set the first `false` to `true` it will post the ZMIN value directly after the tool change. If you want it for every operation a preliminary move of this section to under the operation comment section seems to get this done like this:

  if (hasParameter("operation-comment")) {
    var comment = getParameter("operation-comment");
    if (comment && ((comment !== lastOperationComment) || !patternIsActive || insertToolCall)) {
      writeln("");
      writeComment(comment);
      lastOperationComment = comment;
    } else if (!patternIsActive || insertToolCall) {
      writeln("");
    }
  } else {
    writeln("");
  }
  
  var showToolZMin = true;
  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());
    }
  }
Neal Stein

New to Fusion 360 CAM? Click here for an introduction to 2D Milling, here for 2D Turning.

Find me on:
Instagram and YouTube
0 Likes
Message 3 of 5

GermanWings
Advocate
Advocate

Hello, 

I checked this code in my post , this code gives Max Depth not for particular section but gives max depth of a section where the tool is going deepest, so this option is not relevant

0 Likes
Message 4 of 5

Steinwerks
Mentor
Mentor

Like I said, you have to move it to the relevant area of the post if you want it at every operation. That was the second example I gave.

Neal Stein

New to Fusion 360 CAM? Click here for an introduction to 2D Milling, here for 2D Turning.

Find me on:
Instagram and YouTube
0 Likes
Message 5 of 5

GermanWings
Advocate
Advocate

@Steinwerks I checked the snippet you posted did some changes in it after couple of tries found that zranges Exapand to global range is what we don't want to limit the zrange to current active section , here is the code I modified to get what I wanted.

 

  //edits
  //from autodesk forums to seek tool depth for each operation

  var showToolZMin = true;
  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);
        //writeComment(localize(JSON.stringify(section)));
        if (section.getTool().number != number) {
          break;
        }
        //zRange.expandToRange(section.getGlobalZRange());
      }
      writeComment(localize("This Operation Max Depth ") + ": " + zRange.getMinimum());
    }
  }
0 Likes