How to change the layer LineType

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

Moderators: SDS, support, admin

Post Reply
brace
Posts: 4
Joined: 05 Mar 2015, 12:18

How to change the layer LineType

Post by brace » 10 Jan 2017, 02:02

To change the Layer color i do

Code: Select all

vDrawing.Converter.LayerByName('0').Color := clRed;
But to change the line type

Code: Select all

vDrawing.Converter.LayerByName('0').LineType := WHAT?
Moreover where is the documentation about this property?

Thanks a lot.

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

Re: How to change the layer LineType

Post by support » 10 Jan 2017, 16:11

Hello,

TsgDXFLinetype objects are stored in the LTYPES section, each line type has a unique name. So you can retrieve a line type by its name and apply it to the layer. For example:

Code: Select all

vDrawing.Converter.LayerByName('0').LineType := vDrawing.Converter.Sections[csLTypes].FindEntByName('ISO dash') as TsgDXFLineType;
TsgDXFLayer.LineType property is documented in CAD VCL help which is available online:
http://cadsofttools.com/help/cadvcl/tsg ... netype.htm


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

brace
Posts: 4
Joined: 05 Mar 2015, 12:18

Re: How to change the layer LineType

Post by brace » 10 Jan 2017, 17:06

THanks for the reply.

I tried to use your code but i still create a continuous line.

I suspect this is because i need to call Loaded as described in the help.

PROBLEM 1
Please tell me how to use Loaded in this case:

Code: Select all

var
  vDrawing: TsgCADDXFImage;
begin
  vDrawing := TsgCADDXFImage.Create;
  vDrawing.LoadFromFile('../../TwoSimpleLayers.dxf');
  // Changes color of Layer '0'
  vDrawing.Converter.LayerByName('0').Color := clRed;
  vDrawing.Converter.LayerByName('1').Color := clGreen;
  vDrawing.Converter.LayerByName('1').LineType := vDrawing.Converter.Sections[csLTypes].FindEntByName('ISO dash') as TsgDXFLineType;;
  Loaded; // <----- HOW TO?

  Image1.Canvas.StretchDraw(Rect(0, 0,
    Round(vDrawing.Width * Image1.Height / vDrawing.Height), Image1.Height), vDrawing);
  vDrawing.Free;
PROBLEM 2
Where do i find the complete list of options ("ISO dash" is one and the others)?

Thanks

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

Re: How to change the layer LineType

Post by support » 11 Jan 2017, 13:30

Hello,

You should call a TsgDXFConverter.Loads procedure which reloads a modified object (TsgDXFEntity or its derivatives) in the TsgDXFConverter. For the layer "1" the Loads call will be the following:

Code: Select all

vDrawing.Converter.Loads(vDrawing.Converter.LayerByName('1'));
The linetypes list depends on a drawing file, you can see all the available linetypes in AutoCAD: open the drawing file and enter LINETYPE at the Command prompt, the Linetype Manager window will be displayed.


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

Brooklyn19
Posts: 1
Joined: 17 Jan 2017, 11:03
Location: USA

Re: How to change the layer LineType

Post by Brooklyn19 » 25 Jan 2017, 12:13

support wrote:Hello,

You should call a TsgDXFConverter.Loads procedure which reloads a modified object (TsgDXFEntity or its derivatives) in the TsgDXFConverter. reviews of phenq For the layer "1" the Loads call will be the following:

Code: Select all

vDrawing.Converter.Loads(vDrawing.Converter.LayerByName('1'));
The linetypes list depends on a drawing file, you can see all the available linetypes in AutoCAD: open the drawing file and enter LINETYPE at the Command prompt, the Linetype Manager window will be displayed.


Mikhail
Thanks Mikhail,

julialbert
Posts: 1
Joined: 12 Aug 2017, 11:58

Re: How to change the layer LineType

Post by julialbert » 12 Aug 2017, 12:03

Brooklyn19 wrote:
support wrote:Hello,

You should call a TsgDXFConverter.Loads procedure which reloads a modified object (TsgDXFEntity or its derivatives) in the TsgDXFConverter. Reviews of phen375 For the layer "1" the Loads call will be the following:

Code: Select all

vDrawing.Converter.Loads(vDrawing.Converter.LayerByName('1'));
The linetypes list depends on a drawing file, you can see all the available linetypes in AutoCAD: open the drawing file and enter LINETYPE at the Command prompt, the Linetype Manager window will be displayed.


Mikhail
It works good, Thanks Mikhail

Post Reply