• 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

Creating a custom operation

Objectives

  • Create a new operation type with settings.

Practical part

Order of actions:

  • Open the repository in our GitVerse account and clone it.
  • Find the directory Operation\ExtensionOperationSimpleNet - this is what you will base your new extension on.
  • Pay attention to:
    • XML-file project\main\OperationSimpleNet.xml - this file contains the operation settings:
      • Settings that allow SprutCAM to understand that the tool path calculation is handled by an external extension;
      • Operation settings that the user can configure in the UI;
      • ContainerID cannot be changed;
      • SolverID contains value, which will be later provided into ExtensionFactory.Create;
    • ExtensionFactory.cs:
      • Methods OnLibraryRegistered and OnLibraryUnRegistered - they edit the global UserOperationsList.xml, which contains custom operations.
    • The tool path calculation is performed in a subthread, and .NET only allows working with COM objects created in the same thread. Therefore, you should avoid declaring the properties of ExtensionOperationSimpleNet in RunInitialize.
  • Modify main.cpp (optional). You can write your own code using the API - there are no restrictions.
  • Call task 'Pack', which will create *.dext file - execute it. This action must be performed the first time - only then will the global UserOperationsList.xml be edited. It will add the path to bin\Release\OperationSimpleNet.xml.
  • Restart SprutCAM to update list of available operation types;
  • Click to add new operation. It should be located in the group specified in the XML file under the MultiGroup node. If it’s not there, check with unavailable operations specified.
  • Click generate toolpath on the new operation.
In this article
Back to top Generated by DocFX