How to use GetInput after GetPoint?

Discussion in 'AutoCAD' started by Hadi S., Sep 16, 2003.

  1. Hadi S.

    Hadi S. Guest

    Hi,

    here is my code to get keyword input:
    _______________________________________________________

    On Error Resume Next

    Dim keywordList As String
    keywordList = "Key1 kEy2 keY3"
    ThisDrawing.Utility.InitializeUserInput 128, keywordList

    ' Get the user input
    Dim st As Variant
    Dim returnPnt As Variant

    st = ThisDrawing.Utility.GetPoint(, "pick first point:")
    returnPnt = ThisDrawing.Utility.GetPoint(st, "pick second point or
    <Key1 kEy2 keY3>: ")
    If Err Then
    If StrComp(Err.Description, "User input is a keyword", 1) = 0 Then
    Dim inputString As String
    Err.Clear
    inputString = ThisDrawing.Utility.GetInput
    ' DO SOMETHING WITH INPUT KEYWORD
    Else
    MsgBox "Error selecting the point: " & Err.Description
    Err.Clear
    End If
    Else
    ' DRAW A LINE FROM st TO returnPnt
    End If
    ________________________________________________________

    when i run the code, and enter a keyword for second GetPoint command,
    it doesn't jump to "If Err Then" line, and loops in second GetPoint
    with "Invalid Point" error in ACAD command line.
    but if i remove the first GetPoint method and the optional Point
    parameter of the second GetPoint method, it works fine!!!
    i've tested this with ACAD sample code for "InitializeUserInput".
    can anyone tell me what is wrong?

    thanks

    Hadi Sharghi
     
    Hadi S., Sep 16, 2003
    #1
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.