public sub testsomestuff
Dim stampstring As String = "I stamped this drawing"
Dim thisDB As Database = HostApplicationServices.WorkingDatabase
Using trans As Transaction = thisDB.TransactionManager.StartTransaction
Dim bt As BlockTable = trans.GetObject(thisDB.BlockTableId, OpenMode.ForWrite, False, True)
Dim modelsp As BlockTableRecord = trans.GetObject(bt(BlockTableRecord.ModelSpace), OpenMode.ForWrite)
Dim stampText As DBText = New DBText()
stampText.TextString = stampString
stampText.Height = 12
stampText.HorizontalMode = TextHorizontalMode.TextRight
stampText.Rotation = 0
modelsp.AppendEntity(stampText)
trans.AddNewlyCreatedDBObject(stampText, True)
trans.Commit()
thisDB.Dispose()
End Using
end sub
that code works for me......
obviously it runs from inside autocad....
I would recommend stepping through the code line by line to make sure every line is executing.