1、当前活动文档
Dim doc As ApplicationServices.Document = ApplicationServices.Application.DocumentManager.MdiActiveDocumentView Code
2、拾取图元
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 IfView Code