Adding lines to a BLOCK

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

Moderators: SDS, support, admin

Post Reply
siveco
Posts: 2
Joined: 22 Nov 2014, 21:30

Adding lines to a BLOCK

Post by siveco » 22 Nov 2014, 23:01

Hello,
In order to add a line to a block definition I used something like:

line1 := TsgDXFLine.Create;
line1.Point := MakeFPoint(80, 100, 0);
line1.Point1 := MakeFPoint(150, 150, 0);
line1.Color := clBlue;
line1.Layer := FCADFile.Converter.LayerByName(cnstLayerName);
line1.SetLType(FCADFile.Converter.LTypeByName(cnstLTypeName));
line1.LineWeight := 0.7;
...
vBlock.AddEntity(line1);

It doesn't seem to work... Can you please help?

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

Re: Adding lines to a BLOCK

Post by support » 24 Nov 2014, 19:31

Hello,

Check if the line is added onto a layout and loaded into TsgDXFConverter as shown below:

Code: Select all

var
  CADImage: TsgCADImage;
...

CADImage.CurrentLayout.AddEntity(line1);
if Assigned(CADImage.Converter.OnCreate) then
  CADImage.Converter.OnCreate(line1);
CADImage.Converter.Loads(line1);
After adding a line (or any other entity) to a block definition, call TsgDXFConverter.Loads() for TsgDXFBlock entity. In other words, reload a block in TsgDXFConverter after modifying:

Code: Select all

CADImage.Converter.Loads(vBlock);
Mikhail
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support

siveco
Posts: 2
Joined: 22 Nov 2014, 21:30

Re: Adding lines to a BLOCK

Post by siveco » 24 Nov 2014, 22:06

Hello,
Thank you, it worked great.
Best regards.

Post Reply