Page 1 of 1

Adding lines to a BLOCK

Posted: 22 Nov 2014, 23:01
by siveco
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?

Re: Adding lines to a BLOCK

Posted: 24 Nov 2014, 19:31
by support
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

Re: Adding lines to a BLOCK

Posted: 24 Nov 2014, 22:06
by siveco
Hello,
Thank you, it worked great.
Best regards.