TonCut Desktop Plugin API
This site documents the public plugin surface used by TonCut Desktop. It is built from the current public interface units in the Desktop codebase, with TonCut Engine docs used only to align terminology for shared concepts such as devices, materials, pieces, stock, and cutting results. The descriptions are written to stay useful across Delphi, VS C++, C++Builder, and C# examples.
Getting started
TonCut Desktop loads plugins from Plugins\ recursively, expects a .plg binary that exports TcpInitializeV2, and treats ITcPlugin as the public runtime contract. Import plugins usually fill IDevices, IMaterials, IBands, IProjects, IFormats, and ISheets. 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, C++Builder (untested, provided as-is), VS C++, and C#, and the Markdown manuals. This site documents exactly that package.
Guides
Quickstart
Build a minimal Desktop plugin and understand the required entrypoint and initialization flow.
SDK
Use the external SDK package with public interfaces, manuals, and ready-to-open examples.
Lifecycle & Capabilities
Learn how TonCut loads plugins, matches features to callbacks, and handles config, language, and UI scale.
Import Plugins
See how file detection, extension registration, and host data population work in the combined CSV starter.
Export, Result & Plot
Work with solution output, batch saving, plotter metadata, and plot-oriented result exporters.
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 term | TonCut Desktop plugin API |
|---|---|
| Device | IDevice |
| Material / material group | IMaterial |
| Veneer / band | IBand / IBanding |
| Piece | IFormat |
| Stock / stock item | ISheet / IStandardSheet |
| Cutting / output sheet | ISolutionSheet |
| Output piece | ISolutionFormat |
| Waste | ISolutionWaste |
| Cut | ISolutionCut |
Desktop-specific behavior always wins when the Engine docs and the local source diverge. In particular, the Desktop host contract defines plugin loading, extension enumeration, compatibility checks, and the exact result codes used during file matching and batch export.