Installation of coordinates TsgDXFInsert

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

Moderators: SDS, support, admin

Post Reply
Yura
Posts: 8
Joined: 06 May 2006, 11:07

Installation of coordinates TsgDXFInsert

Post by Yura » 07 Jun 2006, 13:17

I do so:

Code: Select all

vInsert:TsgDXFInsert;
...
vInsert.Point:=MakeFPoint(0, 0, 0); // Passes
vInsert.Block.Offset:=MakeFPoint(0, 0, 0); //Passes
vInsert.Block.Entities[0].Box.TopLeft:=MakeFPoint(1, 2, 0); // Not pass, writes:
[Error] MainUnit.pas(192): Left side cannot be assigned to
How to install last coordinate?

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

Post by support » 07 Jun 2006, 14:18

Hello Yura,

Property <b>TsgDXFEntity.Box: TFRect;</b> is read only. That is why you get error when compiling. This property determines a 3d box which embraces the entity.

The following code sets coordinates of the second point.

Code: Select all

  <b>if</b>  vInsert.Block.Entities[0] <b>is</b> TsgDXFLine <b>then
  begin</b>
    TsgDXFLine(vInsert.Block.Entities[0]).Point1 := MakeFPoint(1, 2, 0); 
    ... 
  <b>end</b>;
Sergey.

please post questions to the forum or write to support@cadsofttools.com

Yura
Posts: 8
Joined: 06 May 2006, 11:07

Post by Yura » 07 Jun 2006, 14:52

I so have understood, what for moving TsgDXFInsert it is enough to make so?

Code: Select all

Img: TsgDXFImage;
vInsert:TsgDXFInsert;
...
vInsert.Point:=MakeFPoint(0, 0, 0);
vInsert.Block.Offset:=MakeFPoint(1, 2, 0);
Img.Converter.Loads(vInsert);
Or not?

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

Post by support » 07 Jun 2006, 15:22

Hello again,

<b>TsgDXFInsert.Point</b> - defines coordinates of Insert itself.
<b>TsgDXFInsert.Block.Offset</b> - defines offset of block (inside of insert) respectively to <b>TsgDXFInsert.Point</b>.
The following code demonstrates Insert moving:

Code: Select all

<b>var</b>
  FP: TFPoint;
<b>begin</b>
  FP := vInsert.Point;
  FP.X := FP.X + 100;
  FP.Y := FP.Y + 150;
  vInsert.Point := FP;
  TsgDXFImage(sgImage1.Picture.Graphic).Converter.Loads(vInsert);
  TsgDXFImage(sgImage1.Picture.Graphic).GetExtents;
  ...
<b>end</b>;
It is important to use <b>GetExtents</b> because of coordinates of insert may get out of drawing extensions.

Sergey.

please post questions to the forum or write to support@cadsofttools.com

Yura
Posts: 8
Joined: 06 May 2006, 11:07

Post by Yura » 07 Jun 2006, 16:36

Thanks! All has turned out

Post Reply