Message 1 of 5
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi, How can I change Mtext value of a selected MultiLeader by .NET ?
Solved! Go to Solution.
Hi, How can I change Mtext value of a selected MultiLeader by .NET ?
Solved! Go to Solution.
Quick example:
using (Transaction tr = db.TransactionManager.StartTransaction())
{
var ml = (MLeader)tr.GetObject(entId, OpenMode.ForWrite);
if (ml.ContentType == ContentType.MTextContent)
{
var mtext = ml.MText;
var txt = mtext.Contents;
mtext.Contents = txt.Replace("x", "XX");
ml.MText = mtext;
tr.Commit();
}
}
Thank you So much Jeff
You have always helped me.
another quick question, Can we change Mtext rotation of a mleader by your code as well?
You could have found it yourself (if you'd tried).
var ml = (MLeader)tr.GetObject(entId, OpenMode.ForWrite);
if (ml.ContentType == ContentType.MTextContent)
{
var mtext = ml.MText;
var txt = mtext.Contents;
mtext.Contents = txt.Replace("x", "XX");
mtext.Rotation += Math.PI / 2.0;
ml.MText = mtext;
}
tr.Commit()