CADImportVCL Save changes after delete Entities
Moderators: SDS, support, admin
CADImportVCL Save changes after delete Entities
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
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
-
- Posts: 12
- Joined: 14 Nov 2008, 09:45
Re: CADImportVCL Save changes after delete Entities
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;
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;