• CAMAPI
  • API Documentation
Show / Hide Table of Contents
  • Supported programming languages
    • C#
    • Delphi
    • C++
  • Tutorial lessons
    • Lesson 1 - general introduction to the extension ideology using the example of a C# project
    • Lesson 2 - connecting the SDK to a Delphi project using the build system
    • Lesson 3 - connecting the SDK to a C++ project using the build system
    • Lesson 4 - demonstration of methods for unloading an extension during main application is running
    • Lesson 5 - Creating a custom operation
    • Lesson 6 - Creating a C# application to interact with geometry in main application
    • Lesson 7 - Creating a C# application to connect to main application for managing it
  • System extensions
    • Extension.Util.Common.Dll
    • Extension.Util.Common.Exe
  • Debugging of extensions
    • Debugging a .NET extension using Visual Studio Code
    • Debugging a Delphi extension using RAD Studio
    • Debugging a C++ extension using Visual Studio
  • Entry points
    • Utilitiy in main form
    • Executor for utility in main form
    • New item to the operation's context menu
  • Machining Tools Import
    • Preparing the environment
    • Working with the tool library
    • Working with cutting tools
      • Milling Tools
      • Turning Tools
      • Custom Axial Shaped Tools
    • Working with the tool holder
  • API Documentation
  • External applications
    • Connecting in a C# application
    • Connecting in a Delphi application
    • Connecting in a C++ application

Working with Turning Tools

Turning tools are formed from two parts: the insert part of the cutting edge and the tool holder type. To create a turning tool, the first thing you need to do is select a group of turning tools. Next, you need to choose a compatible type of tool holder and insert part of the cutting edge. You also need to choose tool hand direction. Common tool attributes, such as tool name, tool number, etc., are the same for all subtypes of cutting tools. For example, below is the code for creating a turn tool with an external holder:

//C#
using THDT = MachinigToolsImportTypes.TMTI_TurnToolHolderDimensionTypes;
using TIDT = MachinigToolsImportTypes.TMTI_TurnToolInsertDimensionTypes;
-------------------------------------------------------------
//importer is an instance of IMTI_MachiningToolsImportLibrary
var tool = importer.CreateTurnToolWithExternalHolder();
tool.SetName("My Turn tool");
tool.SetIdentifier("t001");
tool.SetMagazineNumber(1);
tool.SetToolNumber(1);
tool.SetUnits(TMTI_LinearUnits.luMillimeter);
tool.SetDurability(70);

tool.GetHandType().Hand = TMTI_Hand.hRight;

bool isCompatable = tool.SetHolderAndInsertType(
    TMTI_ExternalToolHolderTypes.htA_90deg, 
    TMTI_ExternalToolHolderInsertTypes.itC_80degRhombic);
if (isCompatable) {
    var tdim = tool.GetDimensions();
    tdim.Holder[THDT.hdL1] = 130;
    tdim.Holder[THDT.hdB] = 20;
    tdim.Holder[THDT.hdL3] = 30;
    tdim.Holder[THDT.hdF1] = 30;

    tdim.Insert[TIDT.idL] = 17;
    tdim.Insert[TIDT.idTi] = 2;
    tdim.Insert[TIDT.idRe] = 0.1;
    //if you have changed this property, the holder type is automatically set to undefined
    //tdim.Insert[TIDT.idKr] = 90;
}

var tdir = tool.GetDirections();
tdir.FixingDirection = TMTI_FixingDirection.fdDirect;
tdir.CuttingDirection[TMTI_CuttingDirections.cdS] = true;
tdir.CuttingDirection[TMTI_CuttingDirections.cdE] = true;
tdir.CuttingDirection[TMTI_CuttingDirections.cdSE] = true;

var overh = tool.GetOverhang();
overh.isAutoCalc = false;
overh.Axial = -10;
overh.Radial = 121;
overh.Matching = 1.5;

var tpoints = tool.GetToolingPoints();
tpoints.Corrector[0] = 1;
tpoints.Corrector[1] = 99;
tpoints.TPointX[0] = -2.22;
tpoints.TPointX[1] = 1.11;
tpoints.TPointY[0] = -1.55;
tpoints.TPointY[1] = -0.29;

var cond = tool.GetCuttingConditions();
cond.RotationDirection = TMTI_RotationDirection.rdCCW;
cond.CuttingSpeedMode = TMTI_CuttingSpeedMode.csmCSS;
cond.Coolant.TubeIsOn[0] = false;
cond.Coolant.TubeIsOn[1] = true;
cond.Coolant.TubeIsOn[2] = true;
cond.FeedValue = 2;
//after setting the properties, add this tool to your tool library instance

Code execution result: Cylindrical Mill

Possible variants of compatible parts of the tool and their geometric dimensions can be viewed in the CAM interface.

Helpful links:

  • How to work with turning tools in the CAM interface
  • Preparing the machining tools import api environment
  • GitVerse: Machining tool import API examples

Continue to read:

  • Working with the Tool Holder
In this article
Back to top Generated by DocFX