- var db = HostApplicationServices.WorkingDatabase;
- var doc = Application.DocumentManager.GetDocument(db);
- var ed = doc.Editor;
- using (Transaction tr = db.TransactionManager.StartTransaction())
- {
- var tst = tr.GetObject(db.TextStyleTableId, OpenMode.ForRead) as TextStyleTable;
- var mt =
- new MText
- {
- Location = Point3d.Origin,
- TextStyleId = tst["我的文字样式名"],
- Contents = "123"
- };
|