• 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

Connecting the SDK to a C++ project using the build system

Objectives

  • Create the simplest and functional extension on C++;
  • Connecting the SDK to a C++ project using the build system.

Practical part

Order of actions:

  • Open the repository in our GitVerse account and clone it.
  • Find the directory ExtensionEmptyCpp - this is what you will base your new extension on.
  • Pay attention to:
    • ExtensionEmptyCpp/.stbuild/build/stbuild.csproj - the version of the build system is specified in this file. Over time, you might need to update it to access new features of the build system.
    • ExtensionEmptyCpp/.stbuild/build/build.cs:
      • properties of RestorerNugetProps, where version of SprutTechnology.CAMAPI.SDK.tlb is specified;
      • properties of BuilderMsCppProps, where path to MSBuild.exe is specified (the version from Microsoft Visual Studio is used);
    • ExtensionEmptyCpp\project\main\ExtensionEmptyCpp.settings.json - you can adjust the settings of the displayed menu item - caption, hint and path to icon (relative to dll file);
  • Modify main.cpp (optional). You can write your own code using the API - there are no restrictions. The example is kept as simple as possible to demonstrate the overall process of creating an extension.
  • To execute your code, the project must contain the exported function CreateInstanceOfExtension. It expects the id value from ExtensionEmptyCpp.settings.json as input and returns a reference to the created object.
  • Compile to check functionality.
  • Run special utility to create injectable file: ExtensionEmptyCpp/commands/pack.cmd;
  • If successful, you should have a file named ExtensionEmptyCpp/project/main/x64/Release/ExtensionEmptyCpp.dext. This file can be injected into SprutCAM both on this computer and on any other computer with the current version of SprutCAM.
  • Double click on it in order to inject.
  • Run SprutCAM, open utilities menu and press "Empty extension on C++" (name should accord with "caption" value in JSON).
  • Make sure that Notepad with the project information is open.
In this article
Back to top Generated by DocFX