Page 1 of 1

How to change dimension's text

Posted: 01 Apr 2016, 07:58
by uni016
HI.
I try to change dimension's text with this code.

procedure test;
var
dim: TsgDXFDimension;
begin
..
dim := Cad.CurrentLayout.FindEntbyHandle(DimHandle) as TsgDXFDimension;
dim.Textoverride := 'aaaa';
CadImg.Converter.Loads(dim);
Draw;
end;

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...

Re: How to change dimension's text

Posted: 04 Apr 2016, 20:22
by support
Hello,

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.


Mikhail