How to change dimension's text

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

Moderators: admin, support, SDS

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

How to change dimension's text

Post by uni016 » 01 Apr 2016, 07:58

I try to change dimension's text with this code.

procedure test;
dim: TsgDXFDimension;
dim := Cad.CurrentLayout.FindEntbyHandle(DimHandle) as TsgDXFDimension;
dim.Textoverride := 'aaaa';

But I can't change it. So I do change text value in the dimension's ceText(or ceMText) entity in it's block. so i can change it. but dimension's text entity's position has problem(not apply TextOffset).
And I try to change TextOffset, TextPosVert...etc.. but there are not change too.
How to change textoverride value...

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

Re: How to change dimension's text

Post by support » 04 Apr 2016, 20:22


TsgDXFDimension.TextOverride property changes the dimension text value, but it is not shown on the screen when opening a saved file with AutoCAD because AutoCAD displays the contents of the dimension block by default. Please, try the following steps:

1) Change the TsgDXFDimension.TextOverride property value using your code.
2) Save the modified drawing to a .dxf file.
3) Open the .dxf file with AutoCAD.
4) Select a modified dimension with the mouse and change a value of any property of the given dimension, so that the dimension block could be regenerated by AutoCAD.

Technical Support E-mail:
Chat support on Skype:

Post Reply