Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Last Command?

9 REPLIES 9
Reply
Message 1 of 10
Troadio
485 Views, 9 Replies

Last Command?

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
9 REPLIES 9
Message 2 of 10
Anonymous
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
Message 3 of 10
Anonymous
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
Message 4 of 10
pnorman
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
Message 5 of 10
Troadio
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
Message 6 of 10
Anonymous
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
Message 7 of 10
Anonymous
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
>
Message 8 of 10
pnorman
in reply to: Troadio

If we solve this one we should start looking at the old 'chicken or the egg' problem!!

:)

P
Message 9 of 10
Anonymous
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
>
Message 10 of 10
Anonymous
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!!

:)

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!

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost