zoukankan      html  css  js  c++  java
  • 常用语句

    1、当前活动文档   

     Dim doc As ApplicationServices.Document = ApplicationServices.Application.DocumentManager.MdiActiveDocument

    2、拾取图元

           Dim doc As ApplicationServices.Document = ApplicationServices.Application.DocumentManager.MdiActiveDocument
            Dim peo As New EditorInput.PromptEntityOptions("请指定一个图块")
            With peo
                .SetRejectMessage("需要图块")
                .AddAllowedClass(GetType(DatabaseServices.BlockReference), True)
            End With
    
            Dim per As EditorInput.PromptEntityResult = doc.Editor.GetEntity(peo)
    
            If Not per.Status = EditorInput.PromptStatus.OK Then
                Exit Sub
            End If
    View Code

     3、添加图元

     Using btr As BlockTableRecord = DirectCast(Tr.GetObject(doc.Database.CurrentSpaceId, OpenMode.ForWrite), BlockTableRecord)

        DIM1ID = btr.AppendEntity(ENT)  
    End Using

    Tr.AddNewlyCreatedDBObject(ENT, True)

     4、使用事物处理

    Using dc As ApplicationServices.DocumentLock = doc.LockDocument()
                Using Db As DatabaseServices.Database = doc.Database
                    Using Tr As DatabaseServices.Transaction = Db.TransactionManager.StartTransaction()
    
    
    
                    End Using
                End Using
            End Using
    View Code
  • 相关阅读:
    Java面向对象知识点总结
    JAVA编程必学必会单词集(1)
    Linux 帮助命令
    学习笔记
    day4
    复习
    day5
    day04
    day3
    day02
  • 原文地址:https://www.cnblogs.com/rf8862/p/13726229.html
Copyright © 2011-2022 走看看