其他分享
首页 > 其他分享> > 选择对象时添加选项(KeyWord)

选择对象时添加选项(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)

 

标签:选项,Dim,AutoCAD,Autodesk,KeyWord,选择对象,CurOption1,Add,Keywords
来源: https://www.cnblogs.com/rf8862/p/12356505.html