选择对象时添加选项(KeyWord)

 

        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)

 

上一篇:用AutoCAD画尺寸链小结


下一篇:AutoCAD.Net/C#.Net QQ群:193522571 AutoCAD 的版本号