CADImportVCL Save changes after delete Entities

Discuss and ask questions about CAD VCL (Delphi and C++ Builder).

Moderators: SDS, support, admin

Post Reply
Klemens
Posts: 4
Joined: 01 Dec 2008, 20:36

CADImportVCL Save changes after delete Entities

Post by Klemens » 22 May 2009, 18:44

Hi together,

how do I can save changes of an loaded CAD-DXF-File, after I had deleted some entities or changed color of some entities?
The function "SaveToFile( 'FileName' );" do save the original file.
So it does not help me.

Thanks for tips.

Kind regards
Klemens

Evgeny Chuzhakin
Posts: 12
Joined: 14 Nov 2008, 09:45

Re: CADImportVCL Save changes after delete Entities

Post by Evgeny Chuzhakin » 25 May 2009, 18:36

Hi Klemens,

Thanks for the post.

If you need to save to DXF format, you need to use DXF Export VCL software which works with CAD Import VCL:

Demo Viewer, Unit1.pas:
procedure TForm1.SaveToDXF(AFileName: string);
var
{$IFDEF SG_DXFEXPORT}
vExpMetafile: TsgDXFExport;
{$ENDIF}
vExpCADfile: TsgCADtoDXF;
vGr: TGraphic;
begin
vGr := sgPaintBox.Picture.Graphic;
if (vGr is TsgCADImage) or (vGr is TMetafile) then
begin
if not (vGr is TsgCADImage) then
begin
{$IFDEF SG_DXFEXPORT}
vExpMetafile := TsgDXFExport.Create;
try
vExpMetafile.Canvas.StretchDraw(Rect(0, 0, vGr.Width, vGr.Height), vGr);
vExpMetafile.EndDraw;
vExpMetafile.SaveToFile(AFileName);
finally
vExpMetafile.Free;
end;
{$ENDIF}
end
else
begin
vExpCADfile := TsgCADtoDXF.Create(TsgCADImage(vGr));
try
vExpCADfile.SaveToFile(AFileName);
finally
vExpCADfile.Free;
end;
end;
MessageBox(Application.Handle, PChar(cnstExportMsgDXF), 'WARNING', MB_ICONWARNING);
end
else
ShowMessage(sNotVectorial);
end;

Post Reply