LoadDemandPieceFromDXF
Name
LoadDemandPieceFromDXF
When to use it
After setting the NumberOfDemandPieces property and anytime before the starting the optimization.
Prototype
HRESULT LoadDemandPieceFromDXF(
Index: long /*[in]*/,
FileName: BSTR /*[in]*/,
MultiplicationFactor: long /*[in]*/,
CanRotate: long /*[in]*/,
ExternalID: long /*[in]*/,
Priority: long/*[in]*/,
);
Explanations
With this method you may load a demand piece to be cut from a DXF file.
The number of pieces to be cut is given by the NumberOfDemandPieces property.
The size (bounding box) of each piece can be get using the GetDemandPiece method.
Only the bounding box of the shape is taken into account because this component is intended for rectangular use only.
Only the following entities are read from a DXF file: CIRCLE, ARC, LINE, POLYLINE and VERTEX. All other entities are ignored.
If the DXF file contain multiple shapes, all of them are considered as one and the bounding box is computed so that it will include all shapes.
Parameters
Index - the index of the piece whose information are set. This number is in range [0...NumberOfDemandPieces - 1].
FileName - the name of the DXF file.
MutiplicationFactor - Shapes from the DXF can contain real-value coordinates, but the component needs integer values only. The value of this parameter is multiplied to the size of the bounding box of the shapes in DXF. The obtained real-values (Length and Width) are rounded up to the nearest integer and they will represent the new length and width of the demand piece. If the piece is to be kept at its original size the MultiplicationFactor must be set to 1.
CanRotate - specify if the piece can be rotated or not (1 if yes, 0 if not). See grain direction for more details.
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 GetDemandPiece and GetUtilizedDemandPiece 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.
See Also:
NumberOfDemandPieces, SetDemandPiece, GetDemandPiece, Working with real numbers, Grain direction.