Host Services
This page covers ITonCut and ITcPlotterInfo, the two service interfaces that connect a plugin to the Desktop host. ITonCut gives you shared state and factory helpers. ITcPlotterInfo lets plot-capable plugins describe the target machine or output geometry assumptions, and those values become relevant when a device Driver is set to the plugin Name.
Host gateway
ITonCut is the main service object passed into Initialize. It exposes shared collections such as Devices, Materials, Formats, and Results, but it also provides helper methods for creating materials, bands, and projects, formatting values in host units, and creating or releasing a current solution.
Plot metadata
ITcPlotterInfo is usually populated during plugin initialization. TonCut reads it when a plugin advertises plot or plot-save features and needs to know movement, axis, material-kind, bridge, head-size, and related machine constraints. If a device Driver is assigned to that plugin Name, TonCut can use the plotter info to constrain or override the device settings that are controlled by the plugin.
Interfaces
Declarations are shown in Pascal and, where the SDK's generated language-support manifest lists the member for C++, in C++; the build fails if that manifest no longer matches TonCutPluginSdk.hpp. There is no C# declaration: C# plugins are native-shim-only, so a C++ shim owns every interface on this page. Methods are listed with their accessors folded into properties; open Vtable order for the exact slot sequence, and see ABI and marshalling for type sizes and ownership rules.
ITonCut
Host gateway that exposes shared collections, formatting helpers, selection state, and solution lifecycle control.
- IID
- {FF6C1A96-46C2-4E06-A779-43DAA36DFBE1}
- Parent
- IUnknown (implicit: a Delphi interface without a parent is IUnknown)
- Unit
- uITonCut
Vtable order (28 methods, slots 3 to 30, after the three IUnknown slots)
- function GetUnits(): TUnits;
- function GetPrecision(): Integer;
- function GetPieceIdentification(): TPieceIdentification;
- function GetDevices(): IDevices;
- function GetMaterials(): IMaterials;
- function GetBands(): IBands;
- function GetSheets(): ISheets;
- function GetTemplates(): ITemplates;
- function GetProjects(): IProjects;
- function GetFormats(): IFormats;
- function GetResults(): IResults;
- function GetSolution(): ISolution;
- function GetUsingProjects(): Boolean;
- function GetSelectedProject(): IProject;
- procedure CreateSolution();
- procedure ReleaseSolution();
- function CreateMaterial(const aTitle: WideString; aKind: TMaterialKind; aWidth, aThickness: Cardinal): IMaterial;
- function CreateBand(const aTitle: WideString; aWidth, aThickness, aMaterialThickness, aSurplus: Cardinal): IBand;
- function CreateProject(const aTitle: WideString): IProject;
- function CanCutAnyShapes(const aDevice: IDevice): Boolean;
- function FormatLength(aValue: Integer; aShort: Boolean = False): WideString; overload;
- function FormatLength(aValue: Double; aShort: Boolean = False): WideString; overload;
- function HumanReadableLength(aValue: Double; aShort: Boolean = False): WideString;
- function FormatField(aValue: TField; aShort: Boolean = False): WideString;
- function HumanReadableField(aValue: TField; aShort: Boolean = False): WideString; overload;
- function HumanReadableField(aValue: Double; aShort: Boolean = False): WideString; overload;
- function FormatDegrees(aAngle: Double; aShort: Boolean = False): WideString;
- function FormatRadians(aAngle: Double; aShort: Boolean = False): WideString;
Properties
- Property name
- Units
- Type
- Description
Length unit the user displays. It affects display only: every length in the API is in hundredths of a millimeter regardless.
Declaration
property Units: TUnits read GetUnits;
- Property name
- Precision
- Type
- Integer
- Description
Current host numeric precision for formatting and display.
Declaration
property Precision: Integer read GetPrecision;
- Property name
- PieceIdentification
- Type
- Description
Current host rule for identifying pieces in generated output.
Declaration
property PieceIdentification: TPieceIdentification read GetPieceIdentification;
- Property name
- UsingProjects
- Type
- Boolean
- Description
Whether TonCut groups pieces by projects. When
false, imported pieces are assigned to the single flat project andIFormat.Projectis ignored.Declaration
property UsingProjects: Boolean read GetUsingProjects;
- Property name
- SelectedProject
- Type
- IProject
- Description
Currently selected project when project mode is active.
Declaration
property SelectedProject: IProject read GetSelectedProject;
- Property name
- Devices
- Type
- IDevices
- Description
Shared device collection exposed by the host.
Declaration
property Devices: IDevices read GetDevices;
- Property name
- Materials
- Type
- IMaterials
- Description
Shared material collection exposed by the host.
Declaration
property Materials: IMaterials read GetMaterials;
- Property name
- Bands
- Type
- IBands
- Description
Shared band collection exposed by the host.
Declaration
property Bands: IBands read GetBands;
- Property name
- Sheets
- Type
- ISheets
- Description
Shared stock-sheet collection exposed by the host.
Declaration
property Sheets: ISheets read GetSheets;
- Property name
- Templates
- Type
- ITemplates
- Description
Shared template collection exposed by the host.
Declaration
property Templates: ITemplates read GetTemplates;
- Property name
- Projects
- Type
- IProjects
- Description
Shared project collection exposed by the host.
Declaration
property Projects: IProjects read GetProjects;
- Property name
- Formats
- Type
- IFormats
- Description
Shared format collection exposed by the host.
Declaration
property Formats: IFormats read GetFormats;
- Property name
- Results
- Type
- IResults
- Description
Shared saved-result collection exposed by the host.
Declaration
property Results: IResults read GetResults;
- Property name
- Solution
- Type
- ISolution
- Description
Current solution object exposed by the host.
Declaration
property Solution: ISolution read GetSolution;
Methods
- Method name
- CreateSolution()
- Type
- procedure
- Description
Ask the host to create the current solution object.
Declaration
procedure CreateSolution(); safecall;
- Method name
- ReleaseSolution()
- Type
- procedure
- Description
Ask the host to release the current solution object.
Declaration
procedure ReleaseSolution(); safecall;
- Method name
- CreateMaterial()
- Type
- IMaterial
- Description
Open the modal TonCut material dialog with the supplied values prefilled. If the user confirms, the new material is added to the live database and committed at once; if the user cancels, the method returns
null. Do notAddthe result to a live collection again, and do not use this method inLoadFile: create staged objects with the collection's own factory instead.Declaration
function CreateMaterial(const aTitle: WideString; aKind: TMaterialKind; aWidth: Cardinal; aThickness: Cardinal): IMaterial; safecall;ParametersaTitleconstWideStringHuman-readable title.aKindValue for kind.aWidthCardinalWidth value in hundredths of a millimeter.aThicknessCardinalThickness value in hundredths of a millimeter.ReturnsThe created material, already added to the live database, ornullif the user cancels the dialog.
- Method name
- CreateBand()
- Type
- IBand
- Description
Open the modal TonCut band dialog with the supplied values prefilled. If the user confirms, the new band is added to the live database and committed at once; if the user cancels, the method returns
null. Do notAddthe result to a live collection again, and do not use this method inLoadFile: create staged objects with the collection's own factory instead.Declaration
function CreateBand(const aTitle: WideString; aWidth: Cardinal; aThickness: Cardinal; aMaterialThickness: Cardinal; aSurplus: Cardinal): IBand; safecall;ParametersaTitleconstWideStringHuman-readable title.aWidthCardinalWidth value in hundredths of a millimeter.aThicknessCardinalThickness value in hundredths of a millimeter.aMaterialThicknessCardinalMaterial thickness value in hundredths of a millimeter.aSurplusCardinalSurplus value in hundredths of a millimeter.ReturnsThe created band, already added to the live database, ornullif the user cancels the dialog.
- Method name
- CreateProject()
- Type
- IProject
- Description
Open the modal TonCut project dialog with the supplied values prefilled. If the user confirms, the new project is added to the live database and committed at once; if the user cancels, the method returns
null. Do notAddthe result to a live collection again, and do not use this method inLoadFile: create staged objects with the collection's own factory instead.Declaration
function CreateProject(const aTitle: WideString): IProject; safecall;ParametersaTitleconstWideStringHuman-readable title.ReturnsThe created project, already added to the live database, ornullif the user cancels the dialog.
- Method name
- CanCutAnyShapes()
- Type
- Boolean
- Description
Check whether the selected device supports non-rectangular shapes.
Declaration
function CanCutAnyShapes(const aDevice: IDevice): Boolean; safecall;ParametersReturnsReturnstrueif the device is able to cut out any shapes, not only rectangles.
- Method name
- FormatLength()
- Type
- WideString
- Description
Format a length value using current host settings.
Declaration
function FormatLength(aValue: Integer; aShort: Boolean = False): WideString; overload; safecall;C++ name:
FormatLengthFromInt. The C++ header gives each Pascal overload its own name; the vtable slot is the same.ParametersaValueIntegerValue being formatted, assigned, or stored.aShortBooleanWhether a shortened textual representation should be used.ReturnsThe length formatted as a string using the current host settings.
- Method name
- FormatLength()
- Type
- WideString
- Description
Format a length value using current host settings.
Declaration
function FormatLength(aValue: Double; aShort: Boolean = False): WideString; overload; safecall;C++ name:
FormatLengthFromExtended. The C++ header gives each Pascal overload its own name; the vtable slot is the same.ParametersaValueDoubleValue being formatted, assigned, or stored.aShortBooleanWhether a shortened textual representation should be used.ReturnsThe length formatted as a string using the current host settings.
- Method name
- HumanReadableLength()
- Type
- WideString
- Description
Return a human-readable length string using current host settings.
Declaration
function HumanReadableLength(aValue: Double; aShort: Boolean = False): WideString; safecall;ParametersaValueDoubleValue being formatted, assigned, or stored.aShortBooleanWhether a shortened textual representation should be used.ReturnsA human-readable length string using the current host settings.
- Method name
- FormatField()
- Type
- WideString
- Description
Format an area or field value using current host settings.
Declaration
function FormatField(aValue: TField; aShort: Boolean = False): WideString; safecall;ParametersaValueTFieldValue being formatted, assigned, or stored.aShortBooleanWhether a shortened textual representation should be used.ReturnsThe field or area formatted as a string using the current host settings.
- Method name
- HumanReadableField()
- Type
- WideString
- Description
Return a human-readable area or field string using current host settings.
Declaration
function HumanReadableField(aValue: TField; aShort: Boolean = False): WideString; overload; safecall;C++ name:
HumanReadableFieldFromInt64. The C++ header gives each Pascal overload its own name; the vtable slot is the same.ParametersaValueTFieldValue being formatted, assigned, or stored.aShortBooleanWhether a shortened textual representation should be used.ReturnsA human-readable field or area string using the current host settings.
- Method name
- HumanReadableField()
- Type
- WideString
- Description
Return a human-readable area or field string using current host settings.
Declaration
function HumanReadableField(aValue: Double; aShort: Boolean = False): WideString; overload; safecall;C++ name:
HumanReadableFieldFromExtended. The C++ header gives each Pascal overload its own name; the vtable slot is the same.ParametersaValueDoubleValue being formatted, assigned, or stored.aShortBooleanWhether a shortened textual representation should be used.ReturnsA human-readable field or area string using the current host settings.
- Method name
- FormatDegrees()
- Type
- WideString
- Description
Format an angle expressed in degrees.
Declaration
function FormatDegrees(aAngle: Double; aShort: Boolean = False): WideString; safecall;ParametersaAngleDoubleAngle value supplied to the formatter.aShortBooleanWhether a shortened textual representation should be used.ReturnsThe angle formatted in degrees using the current host settings.
- Method name
- FormatRadians()
- Type
- WideString
- Description
Format an angle expressed in radians.
Declaration
function FormatRadians(aAngle: Double; aShort: Boolean = False): WideString; safecall;ParametersaAngleDoubleAngle value supplied to the formatter.aShortBooleanWhether a shortened textual representation should be used.ReturnsThe angle formatted in radians using the current host settings.
ITcPlotterInfo
Plotter capability descriptor implemented by the plugin and returned from ITcPlugin.PlotterInfo. It is mandatory whenever the plugin advertises a result or plot save flag. When a device Driver names the plugin, TonCut takes the plugin-controlled device settings from it.
- IID
- {6706EAE7-3E78-4841-AAD0-7B2D3F85551E}
- Parent
- IUnknown (implicit: a Delphi interface without a parent is IUnknown)
- Unit
- uITcPlotterInfo
Vtable order (53 methods, slots 3 to 55, after the three IUnknown slots)
- function GetPlotterType(): TTcPlotterType;
- procedure SetPlotterType(aPlotterType: TTcPlotterType);
- function GetMaterialKinds(): TMaterialKinds;
- procedure SetMaterialKinds(aMaterialKinds: TMaterialKinds);
- function GetAxisX(): TTcAxisDirection;
- procedure SetAxisX(aAxisX: TTcAxisDirection);
- function GetAxisY(): TTcAxisDirection;
- procedure SetAxisY(aAxisY: TTcAxisDirection);
- function GetSizeX(): Cardinal;
- procedure SetSizeX(aSizeX: Cardinal);
- function GetSizeY(): Cardinal;
- procedure SetSizeY(aSizeY: Cardinal);
- function GetCanCrossCuts(): Boolean;
- procedure SetCanCrossCuts(aCanCrossCuts: Boolean);
- function GetFullCutsOnly(): Boolean;
- procedure SetFullCutsOnly(aFullCutsOnly: Boolean);
- function GetCanCutAnyShapes(): Boolean;
- procedure SetCanCutAnyShapes(aCanCutAnyShapes: Boolean);
- function GetStripCuts(): TStripCutting;
- procedure SetStripCuts(aStripCuts: TStripCutting);
- function GetMaxStripeWidth(): Integer;
- procedure SetMaxStripeWidth(aMaxWidth: Integer);
- function GetCutsDepthOn(): Boolean;
- procedure SetCutsDepthOn(aCutsDepthOn: Boolean);
- function GetCutsDepth(): Cardinal;
- procedure SetCutsDepth(aCutsDepth: Cardinal);
- function GetCutsDepthIncMargins(): Boolean;
- procedure SetCutsDepthIncMargins(aCutsDepthIncMargins: Boolean);
- function GetTwoDimensionMoves(): Boolean;
- procedure SetTwoDimensionMoves(aTwoDimensionMoves: Boolean);
- function GetPrefferedDirection(): TTcMoveDirection;
- procedure SetPrefferedDirection(aPrefferedDirection: TTcMoveDirection);
- function GetMarginWest(): Cardinal;
- procedure SetMarginWest(aMarginWest: Cardinal);
- function GetMarginNorth(): Cardinal;
- procedure SetMarginNorth(aMarginNorth: Cardinal);
- function GetMarginEast(): Cardinal;
- procedure SetMarginEast(aMarginEast: Cardinal);
- function GetMarginSouth(): Cardinal;
- procedure SetMarginSouth(aMarginSouth: Cardinal);
- function GetBridgeMoveDirection(): TTcMoveDirection;
- procedure SetBridgeMoveDirection(aBridgeMoveDirection: TTcMoveDirection);
- function GetBridgeSize(): Cardinal;
- procedure SetBridgeSize(aBridgeSize: Cardinal);
- function GetHeadSize(): Cardinal;
- procedure SetHeadSize(aHeadSize: Cardinal);
- function GetHeadKnifeSpace(): Cardinal;
- procedure SetHeadKnifeSpace(aHeadKnifeSpace: Cardinal);
- function GetDefaultRotation(): Integer;
- procedure SetDefaultRotation(aDefaultRotation: Integer);
- function GetDefaultMirror(): TMirrors;
- procedure SetDefaultMirror(aDefaultMirror: TMirrors);
- procedure Assign(const aOther: ITcPlotterInfo);
Properties
- Property name
- PlotterType
- Type
- Description
Plotter or machine category described by this object.
Declaration
property PlotterType: TTcPlotterType read GetPlotterType write SetPlotterType;
- Property name
- MaterialKinds
- Type
- Description
Material kinds supported by the plotter.
Declaration
property MaterialKinds: TMaterialKinds read GetMaterialKinds write SetMaterialKinds;
- Property name
- AxisX
- Type
- Description
Mapping of TonCut coordinates to the machine X axis.
Declaration
property AxisX: TTcAxisDirection read GetAxisX write SetAxisX;
- Property name
- AxisY
- Type
- Description
Mapping of TonCut coordinates to the machine Y axis.
Declaration
property AxisY: TTcAxisDirection read GetAxisY write SetAxisY;
- Property name
- SizeX
- Type
- Cardinal
- Description
Maximum usable size along the X axis.
Declaration
property SizeX: Cardinal read GetSizeX write SetSizeX;
- Property name
- SizeY
- Type
- Cardinal
- Description
Maximum usable size along the Y axis.
Declaration
property SizeY: Cardinal read GetSizeY write SetSizeY;
- Property name
- CanCrossCuts
- Type
- Boolean
- Description
Whether cuts are allowed to cross each other.
Declaration
property CanCrossCuts: Boolean read GetCanCrossCuts write SetCanCrossCuts;
- Property name
- FullCutsOnly
- Type
- Boolean
- Description
Whether only full-through cuts are supported.
Declaration
property FullCutsOnly: Boolean read GetFullCutsOnly write SetFullCutsOnly;
- Property name
- CanCutAnyShapes
- Type
- Boolean
- Description
Whether non-rectangular shapes are supported.
Declaration
property CanCutAnyShapes: Boolean read GetCanCutAnyShapes write SetCanCutAnyShapes;
- Property name
- StripCuts
- Type
- Description
Strip-cutting capability mode.
Declaration
property StripCuts: TStripCutting read GetStripCuts write SetStripCuts;
- Property name
- MaxStripeWidth
- Type
- Integer
- Description
Maximum width of one strip cut.
Declaration
property MaxStripeWidth: Integer read GetMaxStripeWidth write SetMaxStripeWidth;
- Property name
- CutsDepthOn
- Type
- Boolean
- Description
Whether cut depth handling is enabled.
Declaration
property CutsDepthOn: Boolean read GetCutsDepthOn write SetCutsDepthOn;
- Property name
- CutsDepth
- Type
- Cardinal
- Description
Configured cut depth.
Declaration
property CutsDepth: Cardinal read GetCutsDepth write SetCutsDepth;
- Property name
- CutsDepthIncMargins
- Type
- Boolean
- Description
Whether cut depth measurements include machine margins.
Declaration
property CutsDepthIncMargins: Boolean read GetCutsDepthIncMargins write SetCutsDepthIncMargins;
- Property name
- TwoDimensionMoves
- Type
- Boolean
- Description
Whether the machine can perform free two-axis movement.
Declaration
property TwoDimensionMoves: Boolean read GetTwoDimensionMoves write SetTwoDimensionMoves;
- Property name
- PrefferedDirection
- Type
- Description
Preferred movement direction.
Declaration
property PrefferedDirection: TTcMoveDirection read GetPrefferedDirection write SetPrefferedDirection;
- Property name
- MarginWest
- Type
- Cardinal
- Description
Machine margin on the west or left edge.
Declaration
property MarginWest: Cardinal read GetMarginWest write SetMarginWest;
- Property name
- MarginNorth
- Type
- Cardinal
- Description
Machine margin on the north or top edge.
Declaration
property MarginNorth: Cardinal read GetMarginNorth write SetMarginNorth;
- Property name
- MarginEast
- Type
- Cardinal
- Description
Machine margin on the east or right edge.
Declaration
property MarginEast: Cardinal read GetMarginEast write SetMarginEast;
- Property name
- MarginSouth
- Type
- Cardinal
- Description
Machine margin on the south or bottom edge.
Declaration
property MarginSouth: Cardinal read GetMarginSouth write SetMarginSouth;
- Property name
- BridgeMoveDirection
- Type
- Description
Preferred movement direction while creating bridges.
Declaration
property BridgeMoveDirection: TTcMoveDirection read GetBridgeMoveDirection write SetBridgeMoveDirection;
- Property name
- BridgeSize
- Type
- Cardinal
- Description
Default bridge size.
Declaration
property BridgeSize: Cardinal read GetBridgeSize write SetBridgeSize;
- Property name
- HeadSize
- Type
- Cardinal
- Description
Cutting-head size.
Declaration
property HeadSize: Cardinal read GetHeadSize write SetHeadSize;
- Property name
- HeadKnifeSpace
- Type
- Cardinal
- Description
Distance between the head reference point and the knife.
Declaration
property HeadKnifeSpace: Cardinal read GetHeadKnifeSpace write SetHeadKnifeSpace;
- Property name
- DefaultRotation
- Type
- Integer
- Description
Default rotation suggested by the plotter descriptor.
Declaration
property DefaultRotation: Integer read GetDefaultRotation write SetDefaultRotation;
- Property name
- DefaultMirror
- Type
- Description
Default mirror state suggested by the plotter descriptor.
Declaration
property DefaultMirror: TMirrors read GetDefaultMirror write SetDefaultMirror;
Methods
- Method name
- Assign()
- Type
- procedure
- Description
Copy values from another object of the same type.
Declaration
procedure Assign(const aOther: ITcPlotterInfo); safecall;Parameters