Keyword Problem

Keyword Problem

Amremad
Collaborator Collaborator
1,124 Views
2 Replies
Message 1 of 3

Keyword Problem

Amremad
Collaborator
Collaborator

 

Imports Autodesk.AutoCAD.EditorInput
Imports Autodesk.AutoCAD.ApplicationServices
Imports Autodesk.AutoCAD.DatabaseServices
Imports Autodesk.AutoCAD.Geometry

Public NotInheritable Class EditInformations
    Private Shared Modification As String
    Private Shared Path As String
    Private Shared InClose As String
    Private Shared DWGType As String
    Public Shared Sub EditInformation()
        InClose = GetSetting("AMR LISP", "Information Editing", "InClose", "Off")
        Modification = GetSetting("AMR LISP", "Information Editing", "Modification", "selected")
        Path = GetSetting("AMR LISP", "Information Editing", "Path", "off")
        DWGType = GetSetting("AMR LISP", "Information Editing", "Type", "on")

        ' create selection filter with typedvalues
        Dim TypedValues(0) As TypedValue
        TypedValues.SetValue(New TypedValue(DxfCode.BlockName, "BIO.Doc.Info"), 0)
        Dim AcSelFtr As SelectionFilter = New SelectionFilter(TypedValues)

        'create keywords options for selection
        Dim AcSelOption As PromptSelectionOptions = New PromptSelectionOptions
        AcSelOption.Keywords.Add("Settings")
        AcSelOption.MessageForAdding = (vbLf & "Select Objects " & AcSelOption.Keywords.GetDisplayString(True))
        AcSelOption.Keywords.Default = "Settings"
        AcSelOption.AllowSubSelections = True
        'start selectionset with keywords and filter

        Dim AcSelPrompt As PromptSelectionResult
        AddHandler AcSelOption.KeywordInput, AddressOf handle_KeywordInput
        AcSelPrompt = Application.DocumentManager.MdiActiveDocument.Editor.GetSelection(AcSelOption, AcSelFtr)

        If AcSelPrompt.Status = PromptStatus.OK Then

        ElseIf AcSelPrompt.Status = PromptStatus.Error Then

        End If
    End Sub
    Private Shared Sub handle_KeywordInput(ByVal sender As Object, ByVal e As SelectionTextInputEventArgs)
        Dim AcKwrdOption As PromptKeywordOptions = New PromptKeywordOptions(vbLf & "Which method you will use  [Modification/InClose/Path/Type]: ", "Modification InClose Path Type")
        AcKwrdOption.Keywords.Default = "Modification"
        Dim AcKwrdResult As PromptResult = Application.DocumentManager.MdiActiveDocument.Editor.GetKeywords(AcKwrdOption)
        If AcKwrdResult.Status = PromptStatus.OK Then
            Select Case AcKwrdResult.StringResult
                Case "Modification"
                    Dim AcKwrdOption2 As PromptKeywordOptions = New PromptKeywordOptions(vbLf & "Which method you will use  [ON/OFF] : ", "ON OFF")
                    AcKwrdOption2.Keywords.Default = Modification
                    Dim AcKwrdResult2 As PromptResult = Application.DocumentManager.MdiActiveDocument.Editor.GetKeywords(AcKwrdOption2)
                    If AcKwrdResult2.Status = PromptStatus.OK Then
                        Modification = AcKwrdResult2.StringResult
                    End If
                Case "InClose"

                Case "Path"

                Case "Type"
            End Select
        End If
    End Sub
End Class

 

 

55.jpg

 

 

in this picture , i can't create a keyword on and off if the user choose Modification

how can i do it?

0 Likes
Accepted solutions (1)
1,125 Views
2 Replies
Replies (2)
Message 2 of 3

Amremad
Collaborator
Collaborator
Accepted solution

sorry i found my error
was here

AcKwrdOption2.Keywords.Default = Modification

and correct to

AcKwrdOption2.Keywords.Default = "ON"
Message 3 of 3

SUGARYeUNGG
Participant
Participant

i have the same issues

0 Likes