Please Help

Discussion in 'AutoCAD' started by Rodney Estep, Jul 29, 2004.

  1. Rodney Estep

    Rodney Estep Guest

    Dear All,
    I have been trying for years now to find the answer to how I can use Visual
    Lisp to create true transparent commands and not have the...

    "COMMANDS MAY NOT BE NESTED MORE THAN 4 DEEP...." error.

    I have several commands that I use this for but perhaps these new ones I
    hafve created will spark someones intrest enough to not only give me help
    but also actaully try it on there end to know for sure it will work. If you
    hit esc or accidentally excute muliple calls to this command you get the
    dreaded error noted above.

    Please consider the following.
    ;;;;creates a zoom window command that is transparent I use this with my 8
    button logitech and accelerator f12 from my menu
    (vl-load-com)
    (DEFUN zw (/ activedoc)
    (setq activedoc (vla-get-ActiveDocument (vlax-get-acad-object)))
    (SETQ CRS (NTH 1 (GRREAD T 5 1))
    CRS (STRCAT (RTOS (NTH 0 CRS) 2 4) "," (RTOS (NTH 1 CRS) 2 4))
    )
    (vla-SendCommand activedoc (strcat "'Z " crs " " ))
    )
    (vlax-add-cmd "zw" 'zw "zw" 1)
    ;;;;
    ;
    ;;;;;;this command works fine for pop0 event with multiple calls. Created
    for use with my logitech 8 button mouse.
    (vl-load-com)
    (DEFUN POP0 (/ activedoc)
    (setq activedoc (vla-get-ActiveDocument (vlax-get-acad-object)))
    (menucmd "P0=BASIC")(menucmd "P0=*")
    )
    (vlax-add-cmd "POP0" 'POP0 "POP0" 1)

    Thanks in Advance
    Rodney
     
    Rodney Estep, Jul 29, 2004
    #1
  2. Rodney Estep

    BillZ Guest

    Why not use vlax methods?

    (setq obj (vlax-get-acad-object))

    (vlax-invoke-method obj "zoompickwindow")

    (vlax-invoke-method obj "zoomall")

    etc.

    Bill
     
    BillZ, Jul 29, 2004
    #2
  3. Rodney Estep

    Rodney Estep Guest

    Bill,
    I tried your method for my zoom command, yes it works but I guess you are
    miising what I am doing. My command only requires a pick to complete the
    zoom window. "zoompickwindow" requires (2) points. How can I pass the
    current cursor position to be the 1st point of the zoomwindow. That was what
    I was doing with the grread in my function. See I don't have this problem
    when I am using my 16 button puck because \ in the buttons menu outpust the
    current cursor position as coord.
    Ex:
    ***BUTTONS3
    '_RTZOOM;
    'Z W \

    However, I am wanting to use the thumb button on the side of my logitech
    mx500 mouse. To do this I have set this button = ctrl+shift+f12. Then use
    the accelerator feature in my menu to invoke my special zoom with this
    button. The sad part of this is that the accelerator commands treat \ as a
    pause instead of current cursor postition. I need my zoom feature to work
    when a lisp routine is active that is the hole reason for this command.

    I guess I need to bite the bullet and jump in head first to the world of
    Visual Lisp. I have been programming In autolisp for 10 years and know it
    pretty well. Does the garden path tutorial help much or do I need to buy a
    book, if so what do you recomend.

    Thanks
    Rodney
     
    Rodney Estep, Jul 30, 2004
    #3
  4. Rodney Estep

    BillZ Guest

    I guess I need to bite the bullet and jump in head first to the world of
    Visual Lisp. I have been programming In autolisp for 10 years and know it
    pretty well. Does the garden path tutorial help much or do I need to buy a
    book, if so what do you recomend.
    <<<
    I started autolispomg about '92 and have recently gotten my feet wet with Vlisp. The help files and this site have been enough but there is a Vlisp "bible" free in a PDF version at:

    http://www.dsxcad.com/book/

    I hear the site will be abandoned soon.

    To me Vlisp has greatly enhanced my Autolisp programming. Although there is a bit of a culture shock adjusting to an object orientated mindset, the added functionality and access to system preferences makes up for it.
    Good luck! :)

    Bill
     
    BillZ, Jul 30, 2004
    #4
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.