Command Line

Discussion in 'AutoCAD' started by sdilucca, Mar 9, 2006.

  1. sdilucca

    sdilucca Guest

    Goal: I want to be able to type customized commands right into the
    command line and have VBA respond to them

    Problem: The BeginCommand event is not triggered if your command is
    unrecognizable by CAD

    Question: How can I trigger an event if any command (for example:
    "drawThreeGuys") is attempted to be excecuted in the command line?
     
    sdilucca, Mar 9, 2006
    #1
  2. sdilucca

    shizitz Guest

    You could make the commands "blank" lisp files, then use the
    "BeginLisp" event to decide which VBA function to run.

    For example, your lisp file would contain:

    (defun C:drawThreeGuys ()
    ()
    )

    And the VBA code would be something like:

    Private Sub AcadDocument_BeginLisp(ByVal FirstLine As String)
    If FirstLine = "(C:drawThreeGuys)" Then
    'Call function for drawThreeGuys here
    End if
    End Sub

    -ez
     
    shizitz, Mar 10, 2006
    #2
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.