LoadMultiplePartsFromDXF
Name
LoadMultiplePartsFromDXF
When to use it
After setting the NumberOfParts property and anytime before the starting the optimization.
Prototype
LoadMultiplePartsFromDXF(
IndexStartPart: long /*[in]*/,
FileName: BSTR/*[in]*/,
RotationStep: double/*[in]*/,
AllowMirror: long/*[in]*/,
HandleOpenCurves: long /*[in]*/,
AllowFillHoles: long /*[in]*/,
Priority: long /*[in]*/,
LoadedOk: long /*[out]*/
PartsCount: long /*[out]*/
UserDefinedData: long /*[in]*/
);
Explanation
Load parts from DXF files containing multiple disjoint components.
The number of pieces to be cut is given by the NumberOfParts property.
The dimensions of each piece can be get using the GetPart method.
Parameters
IndexStartPart- the index of the piece whose information are set. This number is in range [0...NumberOfParts - 1].
FileName - the name of the DXF file where shape is stored.
RotationStep - The step with which the piece may be rotated for a better fit. Smaller steps are better but it can take a longer time. Rotation is given in degrees (between 0 and 360). Rotation center is set using RotationCenter property (value 0 of that property is ignored)
AllowFaceRotation - specify if the piece can be rotated on a different face (1 if yes, 0 if not). Not implemented yet.
HandleOpenCurves - DXF files can contain a sequence of entities which do not form a closed shape. For instance it can contain several lines which do not form a closed polygon. This parameter will tell you how to handle these cases. Possible values are:
0 - ignores open shapes,
1- close (first node is connected to the last node in the shape),
2 - returns an error in the LoadedOk parameter.
AllowFillHoles - 1 if the holes are allowed to be filled by other parts. 0 otherwise. This parameter is applied to all holes of parts loaded with this method call.
Priority - The priority for cutting a piece. 0 is the highest priority. Pieces with a higher priority are nested before pieces with a lower priority.
LoadedOk - specify if the shape was correctly loaded from file. The following values are returned (they can be combine by OR operator):
PartsCount - returns the number of distinct component found in the DXF file. This number should be taken into account when the next method setting a part is called. For instance is the PartsCount is 3 it means that the next call of LoadMultiplePartsFromDXF must have the first parameter equal to the current one + 3.
UserDefinedData- an user defined value.
0 - ok.
1 - IndexStartPart out of range.
2 - Could not open file or invalid file.
4 - Not supported shape.
8 - Curve not closed ! Please check your data or DXFLinkingDistance.
16 - Components of the dxf are overlapping!
32 - Invalid polyshape.
Warning !
Only the following entities are read from a DXF file: CIRCLE, ARC, LINE, POLYLINE and VERTEX. All other entities are ignored.
See also
NumberOfParts, DXFLinkingDistance, LoadPartFromDXF, SetPart, GetPart, RotationType, SetPartVertex, SetPartArc, SetPartHole, SetPartHoleVertex.