.NET

Reply
Mentor
Amremad
Posts: 217
Registered: ‎08-24-2010
Message 1 of 2 (226 Views)
Accepted Solution

Keyword Problem

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

sorry i found my error
was here

AcKwrdOption2.Keywords.Default = Modification

and correct to

AcKwrdOption2.Keywords.Default = "ON"
Mentor
Amremad
Posts: 217
Registered: ‎08-24-2010
Message 2 of 2 (218 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"
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Are You Going To Be @ AU 2014? Feel free to drop by our AU topic post and share your plans, plug a class that you're teaching, or simply check out who else from the community might be in attendance. Ohh and don't forgot to stop by the Autodesk Help | Learn | Collaborate booths in the Exhibit Hall and meet our community team if you get a chance!