Dim doc As Autodesk.AutoCAD.ApplicationServices.Document = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument Dim ed As Autodesk.AutoCAD.EditorInput.Editor = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor ss1: Dim CurOption1 As PromptSelectionOptions = New PromptSelectionOptions() With CurOption1 .RejectObjectsOnLockedLayers = True .AllowSubSelections = False .Keywords.Add("Delete", "Cl", "清除标注信息(Cl)") .Keywords.Add("Add", "Ad", "添加标注信息(Ad)") .Keywords.Add("RotateUCS", "Ro", "旋转坐标系(Ro)") .MessageForAdding = "请选择标注 或" & CurOption1.Keywords.GetDisplayString(True) .MessageForRemoval = "请选择标注 或" & CurOption1.Keywords.GetDisplayString(True) End With Dim filList() As TypedValue = {New TypedValue(0, "DIMENSION")} '{New TypedValue(DxfCode.Start, "text")} Dim filter As New SelectionFilter(filList) '' Adds the event handler for keyword input AddHandler CurOption1.KeywordInput, AddressOf SelectionKeywordInputHandler Dim prEntRes As PromptSelectionResult = Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Editor.GetSelection(CurOption1, filter)