How to change the layer

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

Moderators: SDS, support, admin

Post Reply
hayami
Posts: 18
Joined: 23 Jan 2013, 04:53

How to change the layer

Post by hayami » 13 Jun 2014, 04:41

hello.

I'm trying to do that:
1.Changing the Layer of Entity
2.Rename Layer

Layer has the Entitiy.

Code: Select all

procedure ChangeLayer(AEntity: TsgDXFEntity; AToLayerName: String);
var
    wLayer: TsgDXFLayer;
begin
	wLayer := FCadImage.Converter.LayerByName(AToLayerName);
	AEntity.Layer := wLayer;
	FCadImage.Converter.Loads(AEntity);
	FCadImage.GetExtents;
end;

Code: Select all

procedure RenameLayer(AOldName; ANewName: String);
var
    wLayer: TsgDXFLayer;
begin
	wLayer := FCadImage.Converter.LayerByName(AOldName);
	wLayer.Name := ANewName;
	FCadImage.Converter.Loads(wLayer);
	FCadImage.GetExtents;
end;
Am I wrong?

use version is 9.1.

Thank you.

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

Re: How to change the layer

Post by support » 16 Jun 2014, 11:34

Hello,

Your code is correct.


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

Post Reply