Jump to content

Recommended Posts

Posted

I would like to just type "lc" then space and have the command before the last one be executed, how can I do this.

 

Thanks for an help!

Posted

Hmmm. I can think of CMDNAMES (getting current running function), but I am drawing a blank on this one :unsure:

Posted

Why don't you just hit the up arrow twice then enter?

Posted

Give this a try:

 

(defun c:cbl (/ ws)
 (setq ws (vlax-get-or-create-object "wscript.shell"))
 (repeat 3 (vlax-invoke ws 'sendkeys "{UP}"))
 (vlax-invoke ws 'sendkeys "{ENTER}")
 (vlax-release-object ws)
 (princ)
)

Posted
Why don't you just hit the up arrow twice then enter?

 

I can do that, it's just that my right hand is on the mouse and the left is kinda docked on the "close to space bar" area of the key board.

 

The senario that I would use this, in case you were wondering, is say I rotate something, but i grab the wrong pick point and the rotation is wrong, i want to be able to undo, and then quickly redo the command (RO) before the undo... you know what I mean?

Posted
Give this a try:

 

(defun c:cbl (/ ws)
 (setq ws (vlax-get-or-create-object "wscript.shell"))
 (repeat 3 (vlax-invoke ws 'sendkeys "{UP}"))
 (vlax-invoke ws 'sendkeys "{ENTER}")
 (vlax-release-object ws)
 (princ)
)

 

 

ok, do I have to write an lsp for this? or is there a way to just put it into the cui menu? I'm new to customization, thanks for any help

Posted
Give this a try:

 

(defun c:cbl (/ ws)
 (setq ws (vlax-get-or-create-object "wscript.shell"))
 (repeat 3 (vlax-invoke ws 'sendkeys "{UP}"))
 (vlax-invoke ws 'sendkeys "{ENTER}")
 (vlax-release-object ws)
 (princ)
)

 

 

Thanks, This works!

 

Now my only question is... is there a way to repeat the command before last and have it applied the objects that I had selected for the orignal command? say I want to rotate 30 blocks and I rotate it 45 degrees instead of 30... can I just repeat the command without having to select all the blocks with my mouse again (typing p space says there are no previous objects selected) I assume it could be done if the undo was part of the lsp command... maybe??

 

Thanks again for any help

Posted

Can you post a drawing of what you are trying to accomplish? I don't see how you'd select the objects from the command before last automatically because previous would use the objects from the last command. Like so:

 

(defun c:cbl (/ ws)
 (setq ws (vlax-get-or-create-object "wscript.shell"))
 (repeat 3 (vlax-invoke ws 'sendkeys "{UP}"))
 (vlax-invoke ws 'sendkeys "{ENTER}")
 (vlax-invoke ws 'sendkeys "P")
 (vlax-invoke ws 'sendkeys "{ENTER}")
 (vlax-release-object ws)
 (princ)
)

Posted
Can you post a drawing of what you are trying to accomplish? I don't see how you'd select the objects from the command before last automatically because previous would use the objects from the last command. Like so:

 

(defun c:cbl (/ ws)
 (setq ws (vlax-get-or-create-object "wscript.shell"))
 (repeat 3 (vlax-invoke ws 'sendkeys "{UP}"))
 (vlax-invoke ws 'sendkeys "{ENTER}")
 (vlax-invoke ws 'sendkeys "P")
 (vlax-invoke ws 'sendkeys "{ENTER}")
 (vlax-release-object ws)
 (princ)
)

 

 

well that's kinda the issue. I rotate some objects, then if i want to undo the rotate, and redo the rotate with the same objects i have to reselect them indivudually.

 

I assume that I could write an lsp command that remembers the previous selected objects, undoes the last command (rot, in this case) then redoes the command that was performed before the undo, and applies it to the original objects selected for the command.

 

Is there any way to do this? I appreciate your help, you clearly are better than me at this...

 

I ahve no idea how to post a drawing... sorry

Posted

Let me think about this for a bit......you are familiar with the filter command correct?

Posted
Let me think about this for a bit......you are familiar with the filter command correct?

 

 

lol absolutely not... i know very little about this stuff

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...