Page 1 of 1
How to change the layer LineType
Posted: 10 Jan 2017, 02:02
by brace
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.
Re: How to change the layer LineType
Posted: 10 Jan 2017, 16:11
by support
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
Re: How to change the layer LineType
Posted: 10 Jan 2017, 17:06
by brace
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
Re: How to change the layer LineType
Posted: 11 Jan 2017, 13:30
by support
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
Re: How to change the layer LineType
Posted: 25 Jan 2017, 12:13
by Brooklyn19
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,
Re: How to change the layer LineType
Posted: 12 Aug 2017, 12:03
by julialbert
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