How to get dimension text?

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

Moderators: support, SDS, admin

Post Reply
uni016
Posts: 8
Joined: 30 Nov 2015, 07:21

How to get dimension text?

Post by uni016 » 25 Mar 2016, 12:46

I can't find how to do it.....
How can i get TsgDxfDimension's text? I don't want textoverride value.

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

Re: How to get dimension text?

Post by support » 25 Mar 2016, 18:02

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
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support

Post Reply