I have this code:
I don't know how to make that line 1 to be red and line 2 to be green inside the Mtext
Can somebody help me?
Thanks
Dim ThisDrawing As Autodesk.AutoCAD.ApplicationServices.Document = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument
Dim Editor1 As Autodesk.AutoCAD.EditorInput.Editor
Editor1 = ThisDrawing.Editor
Using Trans2 As Autodesk.AutoCAD.DatabaseServices.Transaction = thisDrawing.TransactionManager.StartTransaction
Dim BlockTable1 As Autodesk.AutoCAD.DatabaseServices.BlockTable
Dim BTrecord As Autodesk.AutoCAD.DatabaseServices.BlockTableRecord
BlockTable1 = ThisDrawing.Database.BlockTableId.GetObject(OpenMode.ForRead)
BTrecord = Trans2.GetObject(ThisDrawing.Database.CurrentSpaceId, OpenMode.ForWrite)
Dim Mtext1 As New Autodesk.AutoCAD.DatabaseServices.MText()
Mtext1.Contents = “This is line 1” & vbCrLf & “This is line 2”
Mtext1.Location = New Autodesk.AutoCAD.Geometry.Point3d(10, 10, 0)
BTrecord.AppendEntity(Mtext1)
Trans2.AddNewlyCreatedDBObject(Mtext1, True)
Trans2.commit
End using