Community
Hi,
Could you please any body suggest on
Inserting text into Autocad drawing file (like inserting image )using c#.
Regards,
Raman
Hi,
Try this post: http://through-the-interface.typepad.com/through_the_interface/2010/06/creating-an-autocad-mtext-obj...
Regards
Hi,
Try this simple text (no style) insert:
Public Sub addText(ByVal p1 As Point3d, ByVal txt As String, ByVal h As Double) Dim doc As Document = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument Dim db As Database = HostApplicationServices.WorkingDatabase() Using acTrans As Transaction = db.TransactionManager.StartTransaction() Dim t As New DBText t.Position = p1 t.TextString = txt t.Height = h Dim acBlkTbl As BlockTable acBlkTbl = acTrans.GetObject(db.BlockTableId, OpenMode.ForRead) '' Open the Block table record Model space for write Dim acBlkTblRec As BlockTableRecord acBlkTblRec = acTrans.GetObject(acBlkTbl(BlockTableRecord.ModelSpace), OpenMode.ForWrite) t.SetDatabaseDefaults() acBlkTblRec.AppendEntity(t) acTrans.AddNewlyCreatedDBObject(t, True) acTrans.Commit() End Using End Sub
Can't find what you're looking for? Ask the community or share your knowledge.