Message 1 of 8
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi
How can I set style to mtext
Regards
Sgear
Dim objIniFile As New clsIni("c:\file\text.ini") Dim doc As Document = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument Dim ed As Editor = doc.Editor Dim db As Database = doc.Database Dim tr As Transaction = db.TransactionManager.StartTransaction() ed.Regen() Using tr Dim pt As Point3d = ed.GetPoint(vbLf & "Select: ").Value Dim mtx As New MText() mtx.Location = pt mtx.SetDatabaseDefaults() mtx.TextHeight = 1 mtx.Width = 35 Dim HK = objIniFile.GetString("MAIN", "HK", "") Dim TP1 = objIniFile.GetString("MAIN", "TP1", "") Dim TP2 = objIniFile.GetString("MAIN", "TP2", "") Dim TP3 = " " + objIniFile.GetString("MAIN", "TP3", "") Dim TP4 = objIniFile.GetString("MAIN", "TP4", "") mtx.Contents = ("{\C1;" + HK + "}\P" + ("{\C1;" + TP1 + "}\P" + ("{\C1;" + TP2 + "}" + ("{\C3;" + TP3 + "}\P" + ("{\C3;" + TP4 + "}\P"))))) mtx.SetAttachmentMovingLocation(mtx.Attachment) Dim btr As BlockTableRecord = DirectCast(tr.GetObject(db.CurrentSpaceId, OpenMode.ForWrite), BlockTableRecord) btr.AppendEntity(mtx) tr.AddNewlyCreatedDBObject(mtx, True) tr.Commit() End Using
Solved! Go to Solution.