Posts: 212
Registered: ‎08-24-2010
Message 1 of 2 (209 Views)
Accepted Solution

Keyword Problem

209 Views, 1 Replies
04-21-2013 02:51 AM


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.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






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

how can i do it?

Posts: 212
Registered: ‎08-24-2010
Message 2 of 2 (201 Views)

Re: Keyword Problem

04-21-2013 03:23 AM in reply to: Amremad

sorry i found my error
was here

AcKwrdOption2.Keywords.Default = Modification

and correct to

AcKwrdOption2.Keywords.Default = "ON"

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community