hardwired Posted March 7, 2008 Posted March 7, 2008 Hi, Like CTRL-TAB cycles through open drawings, is there a way I can cycle through the current drawing's layouts with lisp and tie it into a keyboard shortcut like CTRL-ALT-TAB or something? I can set up the keyboard shortcut afterwards of course, its just the lips routine for cycling to the next layout i need help with.. I could do this in VBA but wouldn't lisp be slightly quicker and easier to incorporate? Quote
ASMI Posted March 7, 2008 Posted March 7, 2008 (defun c:slay(/ actDoc) (vl-load-com) (vlax-for l (vla-get-Layouts (setq actDoc(vla-get-ActiveDocument (vlax-get-acad-object)))) (getint "\nPress Spacebar for next Layout or Esc to Quit... ") (vla-put-ActiveLayout actDoc l) ); end vlax-for (princ) ); end of c:slay Quote
hardwired Posted March 7, 2008 Author Posted March 7, 2008 Hi ASMI, That works great, but I have added it to a command and created a keyboard shortcut for it (CTRL+RIGHT) (right arrow key) and everytime it asked me for the input, but i just want it to step to the next layout to the right. I commented out the input line and it just crashed my pc as it was trying to loop through all layouts by the seems of it.. Anyway, sorry if i wasn't clear in my first post. But now i know what i want, I want one command to step to the next layout to the right and one for the going back one, stepping to the left, which i'll tag to a CTRL+LEFT shortcut command.. Quote
ASMI Posted March 7, 2008 Posted March 7, 2008 What about standard CTRL+Page Up and CTRL+Page Down? Quote
hardwired Posted March 7, 2008 Author Posted March 7, 2008 Hahahaha, i didn't even know that existed, what a donut, lol Ok, well i shall use that then, lol. Thanks ASMI Quote
VVA Posted March 10, 2008 Posted March 10, 2008 If you have a plenty layouts to be switched quickly between them it is possible, using this lisp layout switch.LSP Quote
lefty1cad Posted March 5, 2015 Posted March 5, 2015 i'm looking for autocad lisp routine for using arrow key to advance layout tabs thank you Quote
BIGAL Posted March 6, 2015 Posted March 6, 2015 Have a look at my GOTO.lsp wrote it to do just that goto any layout note goto 0 is modelspace. This is not latest version as can use page 99 and it will go to last page will post later. (defun C:goto ( / lay num) (setq num (getint "\nEnter tab number")) (vlax-for lay (vla-get-Layouts (vla-get-activedocument (vlax-get-acad-object))) (if (= num (vla-get-taborder lay)) (setvar "ctab" (vla-get-name lay)) ) ; if ) ; for ) ; defun (C:goto) 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.