calling a lisp from another lisp

Discussion in 'AutoCAD' started by Odie Silva, Apr 22, 2004.

  1. Odie Silva

    Odie Silva Guest

    I have a routine in a VLX file and I am trying to call it from anothor
    routine but
    it does not work.

    Why not?

    TIA
     
    Odie Silva, Apr 22, 2004
    #1
  2. Odie Silva

    Odie Silva Guest

    The VLX is already loaded and it works if I type the command but it fails if
    I call
    as in (command ".gridWorld")

    as shown below:

    (defun c:repGrid ()
    (if (tblsearch "layer" "grid")
    (if (vl-cmdf ".erase" (ssget "x" '((8 . "Grid"))) "")
    (if (vl-vlx-loaded-p "Towill2004")
    (gridWorld)
    )
    )
    (alert "\nGRID layer not found!")
    )
    (princ)
    )

    thanks
     
    Odie Silva, Apr 22, 2004
    #2
  3. Odie Silva

    Odie Silva Guest

    SORRY this is the correct one

    (defun c:repGrid ()
    (if (tblsearch "layer" "grid")
    (if (vl-cmdf ".erase" (ssget "x" '((8 . "Grid"))) "")
    (if (vl-vlx-loaded-p "Towill2004")
    (command "gridWorld")
    )
    )
    (alert "\nGRID layer not found!")
    )
    (princ)
    )
     
    Odie Silva, Apr 22, 2004
    #3
  4. Odie Silva

    Jeff Mishler Guest

    you might want to try (c:gridworld) in place of (command "gridworld")

    Calling commands defined by the (defun c:xxx method are called in lisp like
    this (c:xxx)

    HTH,
    Jeff
     
    Jeff Mishler, Apr 22, 2004
    #4
  5. Odie Silva

    Odie Silva Guest

    Thanks but (c:gridWorld) does not work either :(

    (defun c:repGrid ()
    (if (tblsearch "layer" "grid")
    (if (vl-cmdf ".erase" (ssget "x" '((8 . "Grid"))) "") ;---- works fine
    up to this point than it ends with no errors
    (if (vl-vlx-loaded-p "Towill2004")
    (command "gridWorld")
    )
    )
    (alert "\nGRID layer not found!")
    )
    (princ)
    )
     
    Odie Silva, Apr 22, 2004
    #5
  6. Odie Silva

    LARRY Guest

    Try (c:gridworld) instead of the command function
     
    LARRY, Apr 22, 2004
    #6
  7. Odie Silva

    Odie Silva Guest

    I already tried (c:gridWorld) to no avail

    Luis,
    what's the correct use of vl-doc-import?

    Itried it but ..nothing either...

    in the help files it says it cannot be placed within a function a
     
    Odie Silva, Apr 22, 2004
    #7
  8. Odie Silva

    Odie Silva Guest

    gridWorld is a .fas function in a .prj inside VLX with multiple projects
     
    Odie Silva, Apr 22, 2004
    #8
  9. Odie Silva

    Odie Silva Guest

    BEAUTIFUL :)

    Thanks Luis,,


    Odie


     
    Odie Silva, Apr 22, 2004
    #9
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.