GetRepositoryPiece
Name
GetRepositoryPiece
When to use it
After setting the sizes using the SetRepositoryPiece method and before the OnFinish event ends.
Prototype
HRESULT GetRepositoryPiece(
Index: long/*[in]*/,
Length: long /*[out]*/,
Width: long/*[out]*/,
TrimTop: long /*[out]*/,
TrimLeft: long /*[out]*/,
TrimBottom: long /*[out]*/,
TrimRight: long /*[out]*/,
ExternalID: long/*[out]*/,
Priority: long/*[out]*/,
NumberOfHoles: long/*[out]*/
);
Explanations
With this method you may get the dimensions of each sheet from Repository.
The number of pieces to be cut is given by the NumberOfRepositoryPieces property.
The dimensions of each piece can be set using the SetRepositoryPiece method.
Parameters
Index - the index of the piece whose information are extracted. This number is in range [0...NumberOfRepositoryPieces - 1].
Length - the length of the piece.
Width - the width of the piece.
TrimTop, TrimLeft, TrimBottom, TrimRight - margins of material that has to be removed due faults (see picture below).
ExternalID - an user defined value which was set by SetRepositoryPiece method.
Priority - priority for cutting a sheet. Lower values means higher priority. 0 is the highest priority. Pieces with higher priority will be cut before pieces with lower priority.
NumberOfHoles - Number of holes of the current Repository sheet. 0 means no holes.
Remark
Trim is an operation of removing faulty margins of a sheet.
There are 2 ways of removing faulty margins of a sheet:
1. Before cutting the sheet. This is the most common case.
2. During the optimization.
CASE 1
Handling things in the first case is very easy. Just trim the sheet and send the resulted sheet (which is smaller than the original) to the optimization. In this case the TrimTop, TrimLeft, TrimBottom, TrimRight must be set to 0.
Example
Assume that your sheet is 3000x2000 units and you have to remove 10 units from each margin. Simply perform the trim before optimization and send to the component a sheet of 2980x1980 units.
Optimization2DX1.SetRepositoryPiece(0, 2980, 1980, 0, 0, 0, 0, 0, 0)
CASE 2
If you want to perform trim operation during optimization you have to set the Trim parameters accordingly (that is, set TrimTop, TrimLeft, TrimBottom, TrimRight to the values that you want).
Optimization2DX1.SetRepositoryPiece(0, 3000, 2000, 10, 10, 10, 10, 0, 0)
In this case there will be some cuttings (returned by GetCut method) which will perform the trim operation. Note that here the trim is not performed for the entire sheet, but only along the pieces to be cut.
See Also:
SetRepositoryPiece, NumberOfRepositoryPieces, Grain direction