Hi Sergey,
I have tried to copy a Line Entity using the copy constructor:
TsgDXFLine *TheEnt;
TheEnt = new TsgDXFLine(*((TsgDXFLine *)FImg->Entities));
It gave me a new Line entity, except with DottedSingPts pointing to the DottedSingPts of the old Line entity. That is, the DottedSingPts of both entities pointing to the same address. Please help to solve this problem. Also, do I miss anything else in doing this way?
thanks
Jason
Copying sgDXFLine?
Moderators: SDS, support, admin
Hello Jason,
Please try the following code:
Sergey.
please post questions to the forum or write to support@cadsofttools.com
Please try the following code:
Code: Select all
<b>void __fastcall</b> TForm1::AssignEntTsgDXFLineLine1Click(TObject *Sender)
{
Dxfimage::TsgDXFImage *vImg = (TsgDXFImage*) sgPaintBox->Picture->Graphic;
<b>if</b> (vImg == NULL) exit;
Dxfconv::TsgDXFConverter *vConverter = vImg->Converter;
Dxfconv::TsgDXFLine *vLine, *vLineOrg = NULL;
<b>for</b> (<b>int</b> i = 0; i < vConverter->Counts[csEntities]; i++)
{
<b>if</b> (String(vConverter->Sections[csEntities]->Entities[i]->ClassName()) == "TsgDXFLine")
{
vLineOrg = (TsgDXFLine*) vConverter->Sections[csEntities]->Entities[i];
<b>break</b>;
}
}
<b>if</b> (vLineOrg != NULL)
{
vLine = <b>new</b> TsgDXFLine;
vLine->AssignEntity(vLineOrg);
vConverter->Sections[csEntities]->AddEntity(vLine);
vConverter->Loads(vLine);
vConverter->OnCreate(vLine);
}
}
please post questions to the forum or write to support@cadsofttools.com
-
- Posts: 24
- Joined: 13 Apr 2006, 16:20
Hi Jason,
CADImportVCL v.5.2.5 (http://www.cadsofttools.com/download/cadimportvcl.zip):
the following entities have AssignEntity() method:
Sergey.
please post questions to the forum or write to support@cadsofttools.com
CADImportVCL v.5.2.5 (http://www.cadsofttools.com/download/cadimportvcl.zip):
the following entities have AssignEntity() method:
Code: Select all
<ul><li>TsgCADCurvePolygon</li>
<li>TsgCADGradientPolygon</li>
<li>TsgCADHatch</li>
<li>TsgCADPolyPolygon</li>
<li>TsgDXFACISEntity</li>
<li>TsgDXFArc</li>
<li>TsgDXFAttdef</li>
<li>TsgDXFCircle</li>
<li>TsgDXFCustomVertex</li>
<li>TsgDXFDimension</li>
<li>TsgDXFEllipse</li>
<li>TsgDXFEntity</li>
<li>TsgDXFInsert</li>
<li>TsgDXFLine</li>
<li>TsgDXFMText</li>
<li>TsgDXFObjectEntity</li>
<li>TsgDXFOle2Frame</li>
<li>TsgDXFPenEntity</li>
<li>TsgDXFPenLine</li>
<li>TsgDXFPolyline</li>
<li>TsgDXFSpline</li>
<li>TsgDXFText</li>
<li>TsgDXFVertex</li></ul>
please post questions to the forum or write to support@cadsofttools.com