Page 1 of 1

TsgDXFText.HAlign : Change the vertical position ?

Posted: 08 Nov 2010, 16:06
by pascal07
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.

Re: TsgDXFText.HAlign : Change the vertical position ?

Posted: 11 Nov 2010, 14:49
by support
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.