Installation of coordinates TsgDXFInsert
Moderators: SDS, support, admin
Installation of coordinates TsgDXFInsert
I do so:
How to install last coordinate?
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
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.
Sergey.
please post questions to the forum or write to support@cadsofttools.com
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>;
please post questions to the forum or write to support@cadsofttools.com
I so have understood, what for moving TsgDXFInsert it is enough to make so?
Or not?
Code: Select all
Img: TsgDXFImage;
vInsert:TsgDXFInsert;
...
vInsert.Point:=MakeFPoint(0, 0, 0);
vInsert.Block.Offset:=MakeFPoint(1, 2, 0);
Img.Converter.Loads(vInsert);
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:
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
<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>;
Sergey.
please post questions to the forum or write to support@cadsofttools.com