Hi Changsong,
it looks like there are some misunderstandings:
[quote user="Changsong Ling"]My purpose is create a text element which text height is 5 mm.[/quote]
As Jon wrote, it's not correct code to rewrite an element not existing in DGN file yet. It's undefined situation.
[quote user="Changsong Ling"]The problem is, the drawing I tested, in most cases the result text height is 5mm.[/quote]
It's recommended to use Text Styles to define text parameters and not to define the parameters in the code individually. If a particual style is assigned to text elements, their parameters can be modified at once through the style parameters, so it should solve the problem with different text sizes.
[quote user="Changsong Ling"]When the problem happened, I checked activesettings.textstyle.height[/quote]
Active text style accessible through ActiveSettings and text style heigh parametr of a particular text element are two different and independent values:
- ActiveSettings are parameters used when an element is created.
- Element parameters are values stored at this specific element.
It means if you define TextHeight for created element and the element is not created correctly, you have to check its parameters, not general ActiveSettings.
With regards,
Jan