创建对象

Posted rf8862

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了创建对象相关的知识,希望对你有一定的参考价值。

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

 

以上是关于创建对象的主要内容,如果未能解决你的问题,请参考以下文章