setting a TsgExpDXFLayer to off for default view

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

Moderators: SDS, support, admin

Post Reply
digitiger
Posts: 19
Joined: 29 May 2006, 10:01

setting a TsgExpDXFLayer to off for default view

Post by digitiger » 14 Jun 2006, 08:45

I am creating five layers in a DXF file which I am exporting from Delphi application. This VCL component is doing the job in an exceelent manner and infact the DXF produced this way is being recognized as of higher quality then the normal ones produced by even good and experienced Draftsmen using AutoCAD.

But now I need two more functionality and perhaps I am not able to find the matching option in the Help or in demo file. so I am back here asking for your help.

I need to set the Z order of layers (not just entities) so that the layers are drawn layers are drawn over each other in a pre determined order only.

Secondly, I need to set the visibility of one layer to off (for default viewing) though if user wishes he may make it on in AutoCAD.

Please help

Thanking you in anticipation

Sunil K Arora
digitiger

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

Post by support » 15 Jun 2006, 14:27

Hello,

<blockquote id="quote"><font size="2" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote">I need to set the Z order of layers (not just entities) so that the layers are drawn layers are drawn over each other in a pre determined order only.<hr height="1" noshade id="quote"></font id="quote"></blockquote id="quote">
Official documentation of AutoCAD sais nothing about such possibility. There is another way to change places of layers.
<b>Converter.Counts[csLayers]</b> returns number of layers in the file.
<b>Converter.Sections[csLayers].Entities</b> gives access to the layers.
It is necessary to get all layers, to clear list <b>Converter.Sections[csLayers].Entities</b> and fill it again in the correct order.
<blockquote id="quote"><font size="2" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote">Secondly, I need to set the visibility of one layer to off (for default viewing) though if user wishes he may make it on in AutoCAD.<hr height="1" noshade id="quote"></font id="quote"></blockquote id="quote">
Just set TsgDXFLayer.Frozen to True/False.

Sergey.

please post questions to the forum or write to support@cadsofttools.com

digitiger
Posts: 19
Joined: 29 May 2006, 10:01

Post by digitiger » 15 Jun 2006, 22:23

I tried to acheive it by following as per your advise

VLayer.Flags := 1;

but perhaps I am still missing something as the layer was still visible in the AutoCAD, when I opened the exported DXF file.

Please help

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

Post by support » 16 Jun 2006, 17:41

Hello,

Please try the following code:

Code: Select all

<b>procedure</b> TForm1.DXFExportTestForum256Click(Sender: TObject);
<b>var</b>
  vDXF: TsgDXFExport;
  Data: TdxfExportData;
  vLayer: TsgExpDXFLayer;
<b>begin</b>
  vDXF := TsgDXFExport.Create;
  <b>try</b>
    // Rectangle POLYLINE
    vLayer := TsgExpDXFLayer.Create('Hatch');
    vDXF.CurrentLayer := vLayer;
    vLayer.Flags := 1;

    FillChar(Data, SizeOf(Data), 0);
    Data.Color := ColorToDXF(clYellow);
    Data.Point.X := 80;
    Data.Point.Y := 10;
    Data.Point1.X := 120;
    Data.Point1.Y := 30;
    vDXF.AddRectangle(Data);
    vDXF.SaveToFile('D:\222.dxf');
  <b>finally</b>
    vDXF.Free;
  <b>end</b>;
<b>end</b>;
Sergey.

please post questions to the forum or write to support@cadsofttools.com

Post Reply