Change MText height using IF statement in C#

Change MText height using IF statement in C#

Anonymous
Not applicable
460 Views
1 Reply
Message 1 of 2

Change MText height using IF statement in C#

Anonymous
Not applicable

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);
                    }

 

 

  

0 Likes
461 Views
1 Reply
Reply (1)
Message 2 of 2

ВeekeeCZ
Consultant
Consultant

@Anonymous 

 

Better post your question to some customization forum HERE . There are folks that understand the C.

 
0 Likes