+ Reply to Thread
Results 1 to 5 of 5
  1. #1
    Junior Member
    Using
    not specified
    Join Date
    Aug 2005
    Posts
    20

    Default reconized mouse click or enter

    Registered forum members do not see this ad.

    Hi people, I need autocad o any function reconized click mouse or enter buttom:example:

    var=thisDrawing.Utility.GetPoint("Point final")
    if clickMouse then
    call functionX()
    elseif enterButtom then
    call FunctionY()
    end if


    Thanx!!!

  2. #2
    Forum Deity David Bethel's Avatar
    Discipline
    Multi-disciplinary
    David Bethel's Discipline Details
    Discipline
    Multi-disciplinary
    Details
    Commercial Food Service
    Using
    AutoCAD pre 2000
    Join Date
    Dec 2003
    Location
    Newport News, Virginia
    Posts
    2,515

    Default

    In plain Autolisp it would look like this:

    Code:
    (while (setq pt (getpoint "\nPick Point:   ))
           (then-do_this))
    (else_so_that)
    This would also allow keyboard input of a point value. -David
    R12 (Dos) - A2K

  3. #3
    Junior Member
    Using
    not specified
    Join Date
    Aug 2005
    Posts
    20

    Default

    Quote Originally Posted by David Bethel
    In plain Autolisp it would look like this:

    Code:
    (while (setq pt (getpoint "\nPick Point:   ))
           (then-do_this))
    (else_so_that)
    This would also allow keyboard input of a point value. -David
    Sorry , I forgot to say in visual basic, thanx!!

  4. #4
    Forum Newbie
    Using
    not specified
    Join Date
    Sep 2005
    Location
    Jacksonville, Florida
    Posts
    2

    Default

    I believe you will need to use the API.
    An example

    The following must be in a Module

    Public Const MK_RBUTTON = &H2
    Public Const VK_RETURN = &HD 'enter
    Public Const VK_ESCAPE = &H1B 'escape

    Public Declare Function GetAsyncKeyState Lib "USER32" (ByVal vKey As Long) As Integer

    The following should be in your thisdrawing object

    Private Sub Key_Test()
    'note use "ESC" key to exit sub
    Dim RightCLick As Boolean
    Dim EnterKey As Boolean
    On Error GoTo err_control
    MyLoop:
    If RightCLick Then
    MsgBox "right click"
    RightCLick = False
    End If
    If EnterKey Then
    MsgBox "enter key"
    EnterKey = False
    End If
    Pnt1 = ThisDrawing.Utility.GetPoint(, "First Point")
    GoTo MyLoop
    err_control:
    If GetAsyncKeyState(VK_ESCAPE) Then
    Exit Sub
    End If
    If GetAsyncKeyState(MK_RBUTTON) Then
    RightCLick = True
    Resume MyLoop
    End If
    If GetAsyncKeyState(VK_RETURN) Then
    EnterKey = True
    Resume MyLoop
    End If
    End Sub

  5. #5
    Junior Member
    Using
    not specified
    Join Date
    Aug 2005
    Posts
    20

    Default

    Registered forum members do not see this ad.

    Thank you very much!!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts