is3D

is3D

GREGROAN1221
Contributor Contributor
324 Views
3 Replies
Message 1 of 4

is3D

GREGROAN1221
Contributor
Contributor

Can someone please tell me why the " if (is3D())" is in the post? It is causing me problems, but I want to make sure it is not necessary before removing it. It is just retrieving the tool information for the comments at the beginning of the program. If the first tool is an end mill it works great but if the first tool is a drill it skips the loop.

 

  // dump tool information
  if (properties.writeTools) {
    var zRanges = {};
    if (is3D()) {
      var numberOfSections = getNumberOfSections();
      for (var i = 0; i < numberOfSections; ++i) {
        var section = getSection(i);
        var zRange = section.getGlobalZRange();
        var tool = section.getTool();
        if (zRanges[tool.number]) {
          zRanges[tool.number].expandToRange(zRange);
        } else {
          zRanges[tool.number] = zRange;
        }
      }
    }
0 Likes
Accepted solutions (1)
325 Views
3 Replies
Replies (3)
Message 2 of 4

GREGROAN1221
Contributor
Contributor

I was doing more testing, and it is not related to tool type. But if the part has multiple tool orientations seems to create the problem. If I comment out it works fine.

0 Likes
Message 3 of 4

GREGROAN1221
Contributor
Contributor

Never mind I found the answer over on a Fusion forum.

0 Likes
Message 4 of 4

AdamKunzo
Collaborator
Collaborator
Accepted solution

is3D() returns true if tool axis points along Z-axis (i.e. 3X operation).

 

In case above post won't output zRanges for tools that are other than 3D (3+2/multiaxis).

0 Likes