TonCut Desktop Plugin API

This site documents the public plugin contract of TonCut Desktop. The reference is generated from the Pascal interface units of the TonCut Plugin SDK, and the guides state how TonCut Desktop loads and calls a plugin. Plugins are 32-bit Windows DLLs written in Delphi or C++; a C# plugin is a C++ native shim that hands work which needs no TonCut interface to managed code. TonCut Engine terms are used only to align names for shared concepts such as devices, materials, pieces, stock, and cutting results.

Getting started

TonCut Desktop loads every .plg file in the Plugins folder next to TonCut.exe and its subfolders, calls the exported TcpInitializeV2, and talks to the returned ITcPlugin for the rest of the session. Import plugins fill staging IMaterials, IProjects, IFormats, and ISheets collections that TonCut then merges. Export or plot-oriented plugins work mainly with ISolution, ISolutionSheet, and ITcPlotterInfo.

Get the SDK

The TonCut Plugin SDK is published on GitHub: codeton-software/toncut-plugin-sdk. It contains the Pascal interface units (include/pascal), the shared C++ header (include/cpp), ready-to-open example projects for Delphi, VS C++, C++Builder (untested, provided as-is), and C# (a C++ native shim with managed CSV code), and the Markdown manuals. This site documents exactly that package.

Guides

Quickstart

Build a complete Delphi or C++ plugin: entry point, project setup, CSV import and export, and PLT result export.

Read more

SDK

Use the external SDK package with public interfaces, manuals, and ready-to-open examples.

Read more

Lifecycle & Capabilities

Learn how TonCut loads, gates, and calls plugins, what each feature flag enables, and how every result code is handled.

Read more

Import Plugins

Register extensions, match files, and fill the staging collections that the Import dialog merges.

Read more

Export, Result & Plot

Walk a solution from layouts to placed pieces, waste, and cuts, with their frames and units, and write PLT output.

Read more

ABI & Marshalling

Win32 only, type sizes, safecall, BSTR and interface ownership, the TcpInitializeV2 entry point, and what C# can do.

Read more

Reference

The grouped reference covers the Desktop contract, host services, shared kernel data model, and the event interfaces used by collections and entities. It is exhaustive at the interface level but organized by workflow instead of by source file.

Reference

Plugin Contract

The public Desktop plugin surface: ITcPlugin, callback wiring, entrypoint rules, and feature gates.

Host Services

ITonCut helpers, shared collections, formatting utilities, and ITcPlotterInfo for plot-capable plugins.

Pieces

IFormat, projects, materials, and the input-side object model used by import and export plugins.

Solutions

Read solution sheets, placed formats, reusable waste, and line or curve cuts when exporting results.

Terminology

TonCut Engine documentation talks about many of the same concepts with different names. Use this mapping when you read both sets of docs:

TonCut Engine termTonCut Desktop plugin API
DeviceIDevice
Material / material groupIMaterial
Veneer / bandIBand / IBanding
PieceIFormat
Stock / stock itemISheet / IStandardSheet
Cutting / output sheetISolutionSheet
Output pieceISolutionFormat
WasteISolutionWaste
CutISolutionCut

Where the Engine documentation and this site differ, follow this site: the Desktop host contract defines plugin loading, extension enumeration, compatibility checks, units, and the result codes used during file matching and export.

Was this page helpful?