Message 1 of 2
Change MText height using IF statement in C#

Not applicable
03-04-2020
03:33 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
I'm trying to change the MText height and position using an if statement, so that when the user chooses a number (e.g 100) the text changes its height to 5. The problem is that value doesn't change it always stays on the default value and position inside the else statement. I tried the switch cases but still the same problem...
if (scaleValue == "100")
{
MText mText = new MText();
mText.Location = new Point3d(pointFourX+5, pointThreeY - 10, 0);
mText.Contents = $"{circles}T14,2φ8(12→26) ";
mText.TextHeight = 5;
mText.LineSpaceDistance = 33;
acBlkTblRec.AppendEntity(mText);
acTrans.AddNewlyCreatedDBObject(mText, true);
}
else
{
MText mText = new MText();
mText.Location = new Point3d(5, pointSevenY - 50, 0);
mText.Contents = $"{circles}T14,2φ8(12→26) ";
mText.TextHeight = 20;
mText.LineSpaceDistance = 33;
acBlkTblRec.AppendEntity(mText);
acTrans.AddNewlyCreatedDBObject(mText, true);
}