Toolbar commands and lisp routines

Discussion in 'AutoCAD' started by LynnG, Dec 13, 2004.

  1. LynnG

    LynnG Guest

    I have a toolbar that is placing a block, on a specific layer, asks for user input on an attribute, etc...works great.
    '-layer s e-fire ^C^C-insert "fh.dwg="
    Now I want to "add" to that same toolbar a lisp routine. When I try to do it this way:
    '-layer s e-fire ^C^C-insert "fh.dwg=";\^C^Ca0
    It finds the block but does not place it and immediately goes into the lisp routine. Any ideas?
     
    LynnG, Dec 13, 2004
    #1
  2. LynnG

    LynnG Guest

    I figure it out...
    '-layer s e-fire ^C^C-insert "fh.dwg=";\\\\ ^C^Ca0

    How do I get it to REPEAT the beginning of this command by using the right-click option? Currently when I right-click, it repeats the "a0" lisp...I need it to repeat the placement of "fh"
     
    LynnG, Dec 13, 2004
    #2
  3. LynnG

    ECCAD Guest

    Try this:

    -layer s 0^c^c-insert;"fh.dwg=";\\\\\^c^ca0

    Bob
     
    ECCAD, Dec 13, 2004
    #3
  4. LynnG

    LynnG Guest

    That did not work, in fact it did not run the lisp routine "a0"
     
    LynnG, Dec 13, 2004
    #4
  5. LynnG

    ECCAD Guest

    You need (5) '\' if you have an attribute.. (4) if not.

    Bob
     
    ECCAD, Dec 13, 2004
    #5
  6. LynnG

    LynnG Guest

    Sorry, I think there might be some confusion on my part.

    The command sets the active layer to e-fire
    '-layer s e-fire

    then it places the block with an attribute
    ^C^C-insert "fh.dwg=";\\\\
    I understand the "5" \'s but it does not allow the execution of the lisp routine unless there is a "right-click" on the mouse. Even more, any more right-clicking just executes the lisp routine.

    Once the block is placed, scaled, rotated, and attribute entered to which the operator wishes, the "a0" lips routine is executed to where it will rotate the attribute text to a 0 anlge once it is selected
    ^C^Ca0

    If a right-click of the mouse occurs after all that, it takes me back to the lisp routine and not the placement of the block.
     
    LynnG, Dec 13, 2004
    #6
  7. Try starting the menu item with *^C^C to make it repeat automatically. Then
    you don't have to right-click to repeat it -- it will just do it until you
    cancel it out. But I do wonder about the ^C^C things in there. The first
    one could be replaced with a simple ; or space, either of which will end
    the layer command, so there's no need for canceling anything. Likewise, if
    the insert command is finished after the \'s, canceling doesn't do anything
    for you. The one situation related to this where I've used a cancel inside
    a menu item is in one that redefines an existing block where I don't want to
    add another one (asks for the block name, then does the
    -INSERT <blockname>=
    routine, and cancels after loading in the new definition, when the insertion
    base point prompt is there).
     
    Kent Cooper, AIA, Dec 13, 2004
    #7
  8. LynnG

    OLD-CADaver Guest

    RIGHT-CLICK repeats the only last command, the lisp function was the last command so that is all that is repeated.

    Try building a lisp routine that includes all the data collection, then inserts the block per the data the executes (c:a0). Putting that on a button should repeat with a right-click.
     
    OLD-CADaver, Dec 13, 2004
    #8
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.