DXF Export of Polylines in BCB6
Posted: 05 Jul 2007, 17:53
Hello,
I have problems in writing polylines to dxf. Possible a very simple and silly error.
I am doing the following:
When debugging, everything seems to work but SaveToFile results in an error.
What am I doing wrong?
Best regards
Richard
I have problems in writing polylines to dxf. Possible a very simple and silly error.
I am doing the following:
Code: Select all
if (SaveDialog1->Execute())
{
TdxfExportData D;
TdxfPoint *Pt;
TsgDXFExport *E = new TsgDXFExport();
double x,y;
try
{
E->Millimetres = true;
D.Color = 1;
for (int i=0; i<view.nShapes; i++)
{
if (view.oShapes[i].GetCount() > 2)
{
D.Points = new TList();
for (int j=0; j<view.oShapes[i].GetCount(); j++)
{
Pt = new TdxfPoint();
view.oShapes[i].GetPoint(j, x, y);
Pt->X = x*1000;
Pt->Y = y*1000;
D.Points->Add(Pt);
}
E->AddPolyLine(D,0);
}
}
E->EndDraw();
E->SaveToFile(SaveDialog1->FileName);
}
__finally
{
delete E;
delete D.Points;
}
}
What am I doing wrong?
Best regards
Richard