DXFExportVCL : how to change layers

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

Moderators: SDS, support, admin

Post Reply
Mariusz
Posts: 1
Joined: 14 Dec 2009, 12:36

DXFExportVCL : how to change layers

Post by Mariusz » 14 Dec 2009, 13:01

Hi,

I make DXF file using metafiles in that way:

vDXF := TsgDXFExport.Create;
try
vDXF.LoadFromMetafile(Image1.Picture.Metafile); //this metalife lies one defaulr layer 0

vLayer := TsgExpDXFLayer.Create('LayerName1');
vLayer.Color:=ColorToDXF(clRed);
vDXF.CurrentLayer := vLayer;
vDXF.LoadFromMetafile(Image2.Picture.Metafile);

vDXF.LoadFromMetafile(Image3.Picture.Metafile); //it should also lie on layer '0'

.... and so on


Usually one metafile on one layer, but in some cases two or more metafiles lie on the same layer.

How, in that case, can I set Current Layer as default layer '0' or any of previous created?


Thanks in advance.
Mariusz

support
Posts: 3271
Joined: 30 Mar 2005, 11:36
Contact:

Re: DXFExportVCL : how to change layers

Post by support » 16 Dec 2009, 11:19

Hello.
vDXF.LoadFromMetafile(Image3.Picture.Metafile); //it should also lie on layer '0'
it shouldn't, because you set layer with name "LayerName1" as current layer
Layer := TsgExpDXFLayer.Create('LayerName1');
vDXF.CurrentLayer := vLayer;
now entities will be drawn to "LayerName1" layer. You can change current layer to any created before by SetLayerByString method.
Also please note: use Clear before calling LoadFromMetafile procedure.

Alexander.
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support

Post Reply