Page 1 of 1

How to get dimension text?

Posted: 25 Mar 2016, 12:46
by uni016
I can't find how to do it.....
How can i get TsgDxfDimension's text? I don't want textoverride value.

Re: How to get dimension text?

Posted: 25 Mar 2016, 18:02
by support
Hello,

To obtain a dimension text, you should iterate through the entities in the dimension block and read a text string contained in a TsgDXFMText. Please look at the code below.

Code: Select all

function GetDimensionText(ADimension: TsgDXFDimension): string;
var
  I: Integer;
begin
  Result := '';
  for I := 0 to ADimension.Block.Count - 1 do
    if ADimension.Block.Entities[I].EntType = ceMText then
      Result := TsgDXFMText(ADimension.Block.Entities[I]).Text;
end;
Mikhail