Hide menu
Loading...
Searching...
No Matches
Licensing and Activation

Introduction

Before Manufacturing Toolkit can be used, a license activation is necessary.

The MTK licensing workflow uses two license types:

  • a Development License, which is embedded into your application and links it to the licensing information in Customer Corner, including enabled import formats, MTK modules, and add-ons;
  • a Runtime License, which is provided at runtime and defines usage limits.

Both licenses are required to use MTK APIs.

Development License

The development license is provided as a language-specific source file (*.cxx for C++, *.cs for C#, .java for Java and *.py for Python). Include this file in your project before building or running your application.

For compiled languages, the development license is compiled into your application. For interpreted languages, the development license file must be available to the interpreter at runtime.

The development license is embedded into your application and links it to the licensing information in Customer Corner. This information defines enabled MTK capabilities, such as import formats, manufacturing processes, and add-ons. Since these capabilities are resolved through the licensing service, your license can be extended without rebuilding your application.

Runtime License

The runtime license defines usage limits, such as the number of imported parts for part-based licensing (Model A) or the maximum number of concurrent processes for concurrency-based licensing (Model B) . Usage information and remaining limits are available in Customer Corner.

In production, place the runtime license file in the same directory as the application executable. Only one runtime license file should be placed next to the executable. The runtime license must match the development license embedded into your application.

For development and debugging scenarios, MTK examples may use a helper or an environment variable to specify the runtime license location explicitly. This approach is intended for development convenience and is not recommended as the default production layout. Avoid hardcoded absolute paths to the runtime license file in production deployments.

On-premises Licensing

For closed deployment environments, an on-premises licensing option is available for concurrency-based licensing (Model B). For details, contact CADEX support.

Customer Corner

The license files do not expose the list of enabled modules, formats or add-ons. This information is available in Customer Corner.

In Customer Corner, you can view license details, runtime licenses, enabled modules and formats, usage statistics and remaining limits.

Licensing Usage Data

For runtime licensing and usage accounting, MTK may send usage information to the licensing service. This information is used to validate runtime licenses, calculate usage and show statistics in Customer Corner.

Depending on the runtime licensing model, the collected data may include:

  • timestamp;
  • runtime license identifier;
  • MTK version;
  • imported file information;
  • file format;
  • file size;
  • import duration;
  • number of imported parts;
  • number of failed parts;
  • client network information, such as IP address.

Usage

Before using MTK APIs, make the runtime license file available to the application and activate the development license through LicenseManager.

The examples below use LicenseHelper to locate the runtime license file during development. In production applications, the recommended approach is to place the runtime license file next to the executable.

Note
Call LicenseManager.Deactivate() before application exit to close the active licensing session. Otherwise, the session remains active until timeout and may keep a concurrency slot occupied.
  • C++
    #include <cadex/LicenseManager/LicenseManager.hxx>
    ...
    #include "../../helpers/LicenseHelper.hxx"
    #include "../../mtk_license.cxx"
    ...
    auto aKey = MTKLicenseKey::Value();
    // Set up the runtime license location.
    // In production, place the runtime license file next to the executable.
    // LicenseHelper is used by examples to locate the runtime license during development.
    if (!LicenseHelper::SetupRuntimeKey()) {
    return 1;
    }
    // Activate the development license.
    // The key is defined in mtk_license.cxx.
    try {
    } catch (const mtk::LicenseError& theException) {
    std::cerr << "Failed to activate Manufacturing Toolkit license: "
    << theException.what() << std::endl;
    return 1;
    }
    ...
    // Deactivate the license before application exit.
    mtk::LicenseManager::Deactivate();
    static bool Deactivate()
    Closes the active licensing session.
    Definition LicenseManager.cxx:640
    static bool Activate(const std::string &theDeveloperKey)
    Activates MTK licensing using the development license key.
    Definition LicenseManager.cxx:191
  • Python
    import mtk.MTKCore as mtk
    import mtk_license as license
    import LicenseHelper
    ...
    aKey = license.Value()
    # Set up the runtime license location.
    # In production, place the runtime license file next to the application executable.
    # LicenseHelper is used by examples to locate the runtime license during development.
    if not LicenseHelper.SetupRuntimeKey():
    return 1
    # Activate the development license.
    # The key is defined in mtk_license.py.
    try:
    mtk.LicenseManager.Activate(aKey)
    except mtk.LicenseError as theException:
    mtk.LicenseManager.Deactivate()
    print("Failed to activate Manufacturing Toolkit license: " + theException.what())
    return 1
    ...
    # Deactivate the license before application exit.
    mtk.LicenseManager.Deactivate()
  • C#
    using cadex;
    using cadex.mtk;
    ...
    string aKey = MTKLicenseKey.Value();
    // Set up the runtime license location.
    // In production, place the runtime license file next to the application executable.
    // LicenseHelper is used by examples to locate the runtime license during development.
    if (!LicenseHelper.SetupRuntimeKey())
    {
    return 1;
    }
    // Activate the development license.
    // The key is defined in mtk_license.cs.
    try
    {
    }
    catch (LicenseError theException)
    {
    Console.WriteLine("Failed to activate Manufacturing Toolkit license: " + theException.what());
    return 1;
    }
    ...
    // Deactivate the license before application exit.
    LicenseManager.Deactivate();
    Defines an exception thrown by a license manager when a valid license could not be acquired.
    Definition LicenseError.hxx:37
    const char * what() const noexcept override
    Returns an error string.
    Definition LicenseError.cxx:50
    Provides MTK licensing activation and deactivation API.
    Definition LicenseManager.hxx:33
    The mtk namespace is intended to become the primary namespace for MTK and replace direct use of the c...
    Definition LicenseError.hxx:27
    Contains classes, namespaces, enums, types, and global functions related to Manufacturing Toolkit.
    Definition LicenseError.hxx:27
  • Java
    import cadex.*;
    import cadex.mtk.*;
    ...
    String aKey = MTKLicenseKey.Value();
    // Set up the runtime license location.
    // In production, place the runtime license file next to the application executable.
    // LicenseHelper is used by examples to locate the runtime license during development.
    if (!LicenseHelper.SetupRuntimeKey()) {
    System.exit(1);
    }
    // Activate the development license.
    // The key is defined in MTKLicenseKey.java.
    try {
    LicenseManager.Activate(aKey);
    } catch (LicenseError theException) {
    LicenseManager.Deactivate();
    System.out.println("Failed to activate Manufacturing Toolkit license: " + theException.what());
    System.exit(1);
    }
    ...
    // Deactivate the license before application exit.

License activation may fail for various reasons. Use try / catch blocks, as shown in the examples above, to handle LicenseError separately from other runtime errors.

For development and debugging, you can specify the runtime license location explicitly, for example by using the MTK_RUNTIME_KEY_LOCATION environment variable or LicenseManager.SetRuntimeKeyLocation() . However, explicit runtime license locations are not recommended for production deployments. In production, place the runtime license file next to the executable and avoid hardcoded paths to the runtime license file.

See also: