TsgDXFText.HAlign : Change the vertical position ?

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

Moderators: SDS, support, admin

Post Reply
pascal07

TsgDXFText.HAlign : Change the vertical position ?

Post by pascal07 » 08 Nov 2010, 16:06

Hello

i must draw a center text ( Horizontal ). I use TsgDXFText and your CADExportDemo exemple code:

i add this line, in your code:

function TForm1.AddText1: TsgDXFText;
begin
Result := TsgDXFText.Create;
Result.Text := 'Text';
Result.Point := MakeFPoint(10, 280, 0);
Result.Height := 10;
Result.SetColor(clTeal);
Result.HAlign := 1; -----------------> MY NEW LINE
Result.Layer := FCADFile.Converter.LayerByName(cnstLayerName);
if not AddEntityToLayout(Result) then
begin
Result.Free;
Result := nil;
end;
end;

Problem: The text is not center, and this Y position moved ( ?? )
What is the solution ?

Thansk
Pascal EY.

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

Re: TsgDXFText.HAlign : Change the vertical position ?

Post by support » 11 Nov 2010, 14:49

Hello Pascal.
TsgDXFText.HAlign property specifies the "Horizontal text justification type" (correspond to group code 72 of DXF specification). This mean text orientation relative to "second alignment point" (AutoCAD) or TsgDXFText.Point1 (VCL). This point is null, the text justified around (0, 0) point. Please specify this point to receive correct result.

Alexander.
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support

Post Reply