Copying Entities from one TDXFImage to Another TDXFImage

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

Moderators: SDS, support, admin

Post Reply
bilcan
Posts: 7
Joined: 19 Aug 2011, 16:37

Copying Entities from one TDXFImage to Another TDXFImage

Post by bilcan » 19 Aug 2011, 16:41

Copying Entities from one TsgDXFImage to Another TsgDXFImage

Is there any way to do that?

Mikhail Zhilin
Posts: 39
Joined: 04 Aug 2011, 11:31
Location: Russia

Re: Copying Entities from one TDXFImage to Another TDXFImage

Post by Mikhail Zhilin » 22 Aug 2011, 12:35

Hello.

Such functionality is provided by the library. You can see Editor demo to figure out how it works. If you need code examples, just see TsgBlockLibrary.CopyAsBlock and TsgBlockLibrary.PasteAsBlock methods.

Best regards,
Mikhail Zhilin,
Soft Gold Ltd.
http://www.cadsofttools.com

bilcan
Posts: 7
Joined: 19 Aug 2011, 16:37

Re: Copying Entities from one TDXFImage to Another TDXFImage

Post by bilcan » 22 Aug 2011, 15:18

I copied entities via following method but I Couldn't select the entities after paste?

for I := 0 to CopyList.Count-1 do
begin
vEnt := TsgDXFEntityClass(TsgDXFEntity(CopyList).ClassType).Create;
vEnt.AssignEntity(TsgDXFEntity(CopyList));
Img.Converter.OnCreate(vEnt);
Img.Converter.Sections[csEntities].AddEntity(vEnt);
Img.Converter.Loads(vEnt);
end;
Img.GetExtents;
FDNavigator.Picture.Graphic := Img;
FDNavigator.Color := Img.BackgroundColor;
//TsgCADImage(sgImage.Picture.Graphic).IsWithoutBorder := True;// without border
FDNavigator.FitToSize;

CopyList.Clear;

Mikhail Zhilin
Posts: 39
Joined: 04 Aug 2011, 11:31
Location: Russia

Re: Copying Entities from one TDXFImage to Another TDXFImage

Post by Mikhail Zhilin » 26 Aug 2011, 18:14

Please, describe how you paste entities after copying (with code snippet).

Mikhail Zhilin,
Soft Gold Ltd.
http://www.cadsofttools.com

Post Reply