• Industries
  • Products
  • Buy
  • Services & Support
  • Communities
  • Visual LISP, AutoLISP and General Customization

    Reply
    Member
    Posts: 5
    Registered: ‎03-20-2007

    Last Command?

    80 Views, 9 Replies
    06-04-2007 09:56 PM
    How can I get the last command that I used?
    Im trying to use that last command in my lisp routine.

    help please.

    Troadio
    ACAD2006
    Please use plain text.
    *Adesu

    Re: Last Command?

    06-05-2007 01:59 AM in reply to: Troadio
    Hi Troadio,
    How about this code.
    [code]
    (defun c:test (/ p1 p2)
    (setq p1 '(0 0 0))
    (setq p2 '(10 5 0))
    (command "_line" p1 p2 "")
    (command "_line")
    (princ)
    )
    [/code]

    wrote in message news:5616163@discussion.autodesk.com...
    How can I get the last command that I used?
    Im trying to use that last command in my lisp routine.

    help please.

    Troadio
    ACAD2006
    Please use plain text.
    *Ken Krupa

    Re: Last Command?

    06-05-2007 08:59 AM in reply to: Troadio
    Well, this would do what you are asking for:
    (defun xxx()(command "")(princ))
    So if the last command was LINE, running (xxx) would start the line command.
    I don't see why you would want to do that though. What are your trying to
    accomplish?

    Also note that the lisp cannot be a command function (c:xxx), because
    running XXX as a command would try to repeat the XXX command.

    Ken Krupa


    wrote in message news:5616163@discussion.autodesk.com...
    How can I get the last command that I used?
    Im trying to use that last command in my lisp routine.

    help please.

    Troadio
    ACAD2006
    Please use plain text.
    Distinguished Contributor
    Posts: 614
    Registered: ‎02-24-2006

    Re: Last Command?

    06-05-2007 01:02 PM in reply to: Troadio
    You might need to be more specific about how you want to use the last command. generally you cant use the command history. But it depends on what you are trying to do exactly

    http://discussion.autodesk.com/thread.jspa?messageID=5499473
    http://discussion.autodesk.com/thread.jspa?messageID=4820677
    http://discussion.autodesk.com/thread.jspa?messageID=4211127

    Regards
    Phill
    Please use plain text.
    Member
    Posts: 5
    Registered: ‎03-20-2007

    Re: Last Command?

    06-05-2007 06:56 PM in reply to: Troadio
    Hi Ken,
    nice tip, Ive been using (defun c:xxx()). It is self repeating and you eplain why. My question now is how could I use this in the command line w/o having to enter (xxx). Just xxx.

    Troadio
    Please use plain text.
    *Ken Krupa

    Re: Last Command?

    06-06-2007 07:02 AM in reply to: Troadio
    You can't do that, you need to do (xxx). I still can't imagine what you're
    trying to accomplish though. If you explain, maybe I (or someone else) could
    suggest something better.

    wrote in message news:5617454@discussion.autodesk.com...
    Hi Ken,
    nice tip, Ive been using (defun c:xxx()). It is self repeating and you
    eplain why. My question now is how could I use this in the command line w/o
    having to enter (xxx). Just xxx.

    Troadio
    Please use plain text.
    *Bill Gilliss

    Re: Last Command?

    06-06-2007 11:04 AM in reply to: Troadio
    Hard to tell, but it sounds like he wants to repeat the previous
    command, maybe inside of MULTIPLE -- he liked it so much he wants to do
    it many times, but doesn't want to retype it.

    Although I see no sign of a system variable like ACADLASTCOMMAND, it has
    to be stored somewhere to be able to be resurrected with (command ""),
    so perhaps there is a registry entry somewhere. But.. would the command
    to retrieve it take its place before it could be read? Deep metaphysics
    here...

    -Bill

    =======

    pnorman wrote:
    > You might need to be more specific about how you want to use the last command. generally you cant use the command history. But it depends on what you are trying to do exactly
    >
    > http://discussion.autodesk.com/thread.jspa?messageID=5499473
    > http://discussion.autodesk.com/thread.jspa?messageID=4820677
    > http://discussion.autodesk.com/thread.jspa?messageID=4211127
    >
    > Regards
    > Phill
    >
    Please use plain text.
    Distinguished Contributor
    Posts: 614
    Registered: ‎02-24-2006

    Re: Last Command?

    06-06-2007 11:12 AM in reply to: Troadio
    If we solve this one we should start looking at the old 'chicken or the egg' problem!!

    :smileyhappy:

    P
    Please use plain text.
    *Ken Krupa

    Re: Last Command?

    06-06-2007 12:58 PM in reply to: Troadio
    I don't think it could be stored in the reg, since each drawing remembers
    what its last command was. It's probably stored somewhere that us mere
    mortals can't get at.

    Ken Krupa

    "Bill Gilliss" wrote in message
    news:5618428@discussion.autodesk.com...
    Hard to tell, but it sounds like he wants to repeat the previous
    command, maybe inside of MULTIPLE -- he liked it so much he wants to do
    it many times, but doesn't want to retype it.

    Although I see no sign of a system variable like ACADLASTCOMMAND, it has
    to be stored somewhere to be able to be resurrected with (command ""),
    so perhaps there is a registry entry somewhere. But.. would the command
    to retrieve it take its place before it could be read? Deep metaphysics
    here...

    -Bill

    =======

    pnorman wrote:
    > You might need to be more specific about how you want to use the last
    > command. generally you cant use the command history. But it depends on
    > what you are trying to do exactly
    >
    > http://discussion.autodesk.com/thread.jspa?messageID=5499473
    > http://discussion.autodesk.com/thread.jspa?messageID=4820677
    > http://discussion.autodesk.com/thread.jspa?messageID=4211127
    >
    > Regards
    > Phill
    >
    Please use plain text.
    *Gekko

    Re: Last Command?

    06-07-2007 04:51 AM in reply to: Troadio
    wrote in message news:5618437@discussion.autodesk.com...
    If we solve this one we should start looking at the old 'chicken or the egg'
    problem!!

    :smileyhappy:

    NO, dont do that, not yet anyways;; we first have to consult Mataeux as
    per his reply to a post 6/7/07. ";error: too few arguements".....
    he will love this!
    Please use plain text.