apsonwane Posted July 22, 2009 Share Posted July 22, 2009 Hi, When you are in layout tab, is it possible to Activate next Layout (in multiple layout drawing) from command line instead of clicking on next layout tab. Tnx, Quote Link to comment Share on other sites More sharing options...
ReMark Posted July 22, 2009 Share Posted July 22, 2009 Wild guess here. Would it be the system variable CTAB? Quote Link to comment Share on other sites More sharing options...
apsonwane Posted July 22, 2009 Author Share Posted July 22, 2009 Wild guess here. Would it be the system variable CTAB? Thanks ReMark, "CTAB" returns the name of current active tab. I would like to activate next layout tab without entering next layout name. Quote Link to comment Share on other sites More sharing options...
ReMark Posted July 22, 2009 Share Posted July 22, 2009 Without entering the layout name? OK. I'll poke around. Maybe a LISP routine would work here? Quote Link to comment Share on other sites More sharing options...
bonehead411 Posted July 22, 2009 Share Posted July 22, 2009 Not command line input as such but Ctrl + Page Up / Down will cycle through layouts. Quote Link to comment Share on other sites More sharing options...
Ashishs Posted July 22, 2009 Share Posted July 22, 2009 Not command line input as such but Ctrl + Page Up / Down will cycle through layouts. Tnx bonehead411, This was new for me & serves purpose. However to make is more handy, is it possible to modify CUI or create a lsp routine so that when I input "NL" on command line to activate next layout. Quote Link to comment Share on other sites More sharing options...
ronjonp Posted July 22, 2009 Share Posted July 22, 2009 Give this a whirl: (defun c:nl () (setvar 'ctab (cadr (member (getvar 'ctab) (layoutlist))))) Quote Link to comment Share on other sites More sharing options...
NBC Posted July 22, 2009 Share Posted July 22, 2009 Cool ron; is it possible to modify that so that it will move to the previous layout ? Quote Link to comment Share on other sites More sharing options...
Ashishs Posted July 22, 2009 Share Posted July 22, 2009 Give this a whirl: (defun c:nl () (setvar 'ctab (cadr (member (getvar 'ctab) (layoutlist))))) Thanks "ron" from prompt answer. This is what I was looking for. Simple & Perfect. Tnx all, Quote Link to comment Share on other sites More sharing options...
apsonwane Posted July 22, 2009 Author Share Posted July 22, 2009 Dear Ron, Works in layouts. But doesn't work when model space is active. Command: NL ; error: AutoCAD variable setting rejected: CTAB nil Quote Link to comment Share on other sites More sharing options...
ronjonp Posted July 22, 2009 Share Posted July 22, 2009 This one should work as advertised (defun c:nl (/ lay next) (vl-load-com) (vlax-map-collection (vla-get-layouts (vla-get-activedocument (vlax-get-acad-object))) '(lambda (x) (setq lay (cons x lay))) ) (if (setq next (cadr (member (getvar 'ctab) (mapcar 'vla-get-name (vl-sort lay '(lambda (x y) (< (vla-get-taborder x) (vla-get-taborder y)))) ) ) ) ) (setvar 'ctab next) (setvar 'ctab "Model") ) (princ) ) Quote Link to comment Share on other sites More sharing options...
NBC Posted July 22, 2009 Share Posted July 22, 2009 not forgetting to include (vl-load-com) immediately after the line beginning defun.... and immediately before the line beginning (vla-get-layouts..... Quote Link to comment Share on other sites More sharing options...
apsonwane Posted July 23, 2009 Author Share Posted July 23, 2009 Thanks ron, This is flawless now. I found similar program here for activating first, next, previous & last layouts. I would like to share this with you- http://www.cadtutor.net/forum/showthread.php?t=36727 Tnx, Quote Link to comment Share on other sites More sharing options...
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.