LineDrawer5 Posted July 21, 2009 Posted July 21, 2009 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! Quote
Lee Mac Posted July 21, 2009 Posted July 21, 2009 Hmmm. I can think of CMDNAMES (getting current running function), but I am drawing a blank on this one Quote
ronjonp Posted July 22, 2009 Posted July 22, 2009 Why don't you just hit the up arrow twice then enter? Quote
ronjonp Posted July 22, 2009 Posted July 22, 2009 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) ) Quote
LineDrawer5 Posted July 22, 2009 Author Posted July 22, 2009 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? Quote
LineDrawer5 Posted July 22, 2009 Author Posted July 22, 2009 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 Quote
LineDrawer5 Posted July 22, 2009 Author Posted July 22, 2009 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 Quote
ronjonp Posted July 22, 2009 Posted July 22, 2009 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) ) Quote
LineDrawer5 Posted July 22, 2009 Author Posted July 22, 2009 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 Quote
ronjonp Posted July 22, 2009 Posted July 22, 2009 Let me think about this for a bit......you are familiar with the filter command correct? Quote
LineDrawer5 Posted July 22, 2009 Author Posted July 22, 2009 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 Quote
Recommended Posts
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.