.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Keyword Problem

1 REPLY 1
SOLVED
Reply
Message 1 of 2
Amremad
588 Views, 1 Reply

Keyword Problem

 

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?

1 REPLY 1
Message 2 of 2
Amremad
in reply to: Amremad

sorry i found my error
was here

AcKwrdOption2.Keywords.Default = Modification

and correct to

AcKwrdOption2.Keywords.Default = "ON"

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost