GetCost- BETA testing.
Name
GetCost
When to use it
You may get the waste during the OnFinish event.
Otherwise the returned value is undefined.
Prototype
HRESULT GetCost(
BarIndex : Long /*in*/,
Cost : Double /*out*/,
RepositoryIndex: Long /*[out]*/,
RepositoryExternalID: Long /*[out]*/
);
Explanations
The cost of utilized material for a particular bar from Repository.
Parameters
BarIndex - is the index of the bar whose waste is request. BarIndex must be between 0 and TotalNumberOfUtilizedRepositoryPieces.
Cost - the result of calling this method is stored in this variable.
RepositoryIndex is the index of bar as it was set by the SetRepositoryPiece2 method. RepositoryIndex is between 0 and NumberOfRepositoryPieces - 1.
RepositoryExternalID is the external ID of the repository piece whose input index is BarIndex. External ID is an integer number which was assigned to each piece in order to be easier identified.
Remarks
The waste piece has the angles for both extremities equals to 90 degrees !
The last cut should always be performed vertically in order to reduce the waste generated by the cutting blade.
The waste computed after this operation as can be seen in the picture below:

If the length of the remaining material (from the end of the useful part to the end of the bar) is less than the BladeWidth, the resulted Waste is 0.
Links