创建对象

1、创建单行文字

  Dim dt As New DatabaseServices.DBText()
  With dt
     .TextString = psr.StringResult
     .Justify = AttachmentPoint.MiddleCenter
     .AlignmentPoint = ppr.Value
     .Position = ppr.Value
     .LineWeight = LineWeight.LineWeight020
  End With
  Using bt As DatabaseServices.BlockTable = CType(tr.GetObject(db.BlockTableId, DatabaseServices.OpenMode.ForWrite), DatabaseServices.BlockTable)
     Using btr As DatabaseServices.BlockTableRecord = CType(tr.GetObject(bt(DatabaseServices.BlockTableRecord.ModelSpace), DatabaseServices.OpenMode.ForWrite), DatabaseServices.BlockTableRecord)
         btr.AppendEntity(dt)
         tr.AddNewlyCreatedDBObject(dt, True)
     End Using
  End Using

 

posted @ 2020-02-21 04:00  rf8862  阅读(115)  评论(0编辑  收藏  举报