SetRepositoryPiece
Name
SetRepositoryPiece
When to use it
After setting the NumberOfRepositoryPieces property and anytime before the OnFinish event ends.
Prototype
HRESULT SetRepositoryPiece(
Index: long /*[in]*/,
Length: long/*[in]*/,
Width: long /*[in]*/,
TrimTop: long /*[in]*/,
TrimLeft: long /*[in]*/,
TrimBottom: long /*[in]*/,
TrimRight: long /*[in]*/,
ExternalID: long/*[in]*/,
Priority: long/*[in]*/,
NumberOfHoles: long/*[in]*/
);
Explanations
With this method you may set the dimensions of each piece from Repository (Stock).
The number of sheets to be cut is given by the NumberOfRepositoryPieces property.
The dimensions of each piece can be get using the GetRepositoryPiece method.
Parameters
Index - the index of the piece whose information are set. This number is in range [0...NumberOfRepositoryPieces - 1].
Length - the length of the piece. This number must be integer. For working with real numbers read here.
Width - the width of the piece. This number must be integer. For working with real numbers read here.
TrimTop, TrimLeft, TrimBottom, TrimRight - margins of material that has to be removed due faults (see picture below).
ExternalID - an user defined value which can help you to track down the piece during the OnFinish event. This value will be returned by the GetRepositoryPiece and GetUtilizedRepositoryPiece methods.
Priority - priority for cutting a piece. 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, 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, 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:
NumberOfRepositoryPieces, GetRepositoryPiece, Working with real numbers, Grain direction.