Problem with DXF Export of Polyline
Posted: 05 Nov 2006, 22:46
I have just bought and down loaded the latest version of DXF Export. I need to build a DXF file and need to export Polylines. The following code I copied from this forum (as the help example did not work) also does not work.
The dxf file produced does not contain correct coordinates, I expected the coordinates seen in the array to be in the dxf. I do not have the source so cannot debug further.
Pleas help.
John
The dxf file produced does not contain correct coordinates, I expected the coordinates seen in the array to be in the dxf. I do not have the source so cannot debug further.
Pleas help.
John
Code: Select all
<b>procedure</b> Test(E: TsgDXFExport);
<b>const</b> arrBezier: <b>array</b> [0..12] <b>of</b> TdxfPoint = (
(X:200;Y:230), (X:190;Y:310), (X:280;Y:330), (X:310;Y:310), (X:340;Y:290),
(X:390;Y:270), (X:355;Y:225), (X:330;Y:240), (X:305;Y:255), (X:415;Y:255),
(X:440;Y:240), (X:480;Y:220), (X:430;Y:200));
<b>var</b>
Pt: PDXFPoint;
D: TdxfExportData;
I: Integer;
<b>begin</b>
D.Points := TList.Create;
<b>try</b>
D.Points.Add(TList.Create);
D.Count := High(arrBezier)-Low(arrBezier)+1;
<b>for</b> I := 0 <b>to</b> D.Count - 1 <b>do
begin</b>
New(Pt);
Pt^.X := arrBezier[I].X;
Pt^.Y := arrBezier[I].Y;
Pt^.Z := 0;
TList(D.Points[0]).Add(Pt);
<b>end</b>;
D.Text := <font color="blue">'ACADISO03W100'</font id="blue">;
E.AddPolyLine(D, 0);
<b>finally
for</b> I := 1 <b>to</b> TList(D.Points[0]).Count - 1 <b>do</b>
Dispose(TList(D.Points[0])[I]);
TList(D.Points[0]).Free;
D.Points.Free;
<b>end</b>;
<b>end</b>;