ibnut Posted March 19, 2009 Share Posted March 19, 2009 I'd like to write a script that will shift everything on every layout tab 6 inches to the left, but can't seem to find a command to switch to the next layout tab. I was wondering if such a command existed and if not, if there was a better way to go about doing so. Thanks! Quote Link to comment Share on other sites More sharing options...
lpseifert Posted March 20, 2009 Share Posted March 20, 2009 using lisp you can use the foreach subr; similar to this (foreach lay (layoutlist)(command "_layout" "_Set" lay "_pspace" "move" "all" "" "0,0" "-6,0")) Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted March 20, 2009 Share Posted March 20, 2009 Or, if you have releases after R14: (foreach lay (layoutlist) (setvar "CTAB" lay) (command "_pspace" "_move" "all" "" "0,0" "-6,0")) Quote Link to comment Share on other sites More sharing options...
ibnut Posted March 20, 2009 Author Share Posted March 20, 2009 Thanks for the tips, both lisps worked perfectly. Another problem that I was running into was that my xrefs were also being moved even though I have them unloaded. Is there a way to get the xrefs to stay put? Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted March 20, 2009 Share Posted March 20, 2009 Maybe this? (defun c:objmove (/ ss) (foreach lay (layoutlist) (if (setq ss (ssget "X" (list (cons 410 lay)))) (progn (foreach e (mapcar 'cadr (ssnamex ss)) (if (= (logand (cdr (assoc 70 (tblsearch "BLOCK" (cdr (assoc 2 (entget e)))))) 4) 4) (ssdel e ss)))) (princ (strcat "\nNo Objects Found in layout " lay)))) (command "_move" ss "" "0,0" "-6,0") (princ)) Quote Link to comment Share on other sites More sharing options...
ibnut Posted March 31, 2009 Author Share Posted March 31, 2009 Sorry, I've been busy for the last two weeks and haven't had a chance to check up on my thread. I'm getting a "; error: bad argument type: stringp nil" message when I try to run the latest lisp that Lee Mac posted. Is there something that I'm missing in the code? Back to my original post, the drawing area available from my titleblock shifted to the left ~6" and I'd like to write a lisp that will shift everything on my layout pages 6" to the left. The first two lisps worked perfectly, but it was also shifting my titleblock (xref'd) despite it being unloaded. Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted March 31, 2009 Share Posted March 31, 2009 My apologies ibnut - I did not test my posted LISP at all, and, upon looking at it again now, I can see that I made quite a few mistakes in my haste to post the code. - my apologies: (defun c:objmove (/ vlst ovar ss) (setq vlst '("CTAB" "CMDECHO" "OSMODE") ovar (mapcar 'getvar vlst)) (mapcar 'setvar (cdr vlst) '(0 0)) (foreach lay (layoutlist) (setvar "CTAB" lay) (if (setq ss (ssget "X" (list (cons 410 lay)))) (progn (foreach e (mapcar 'cadr (ssnamex ss)) (if (and (eq "INSERT" (cdr (assoc 0 (entget e)))) (= (logand (cdr (assoc 70 (tblsearch "BLOCK" (cdr (assoc 2 (entget e)))))) 4) 4)) (ssdel e ss))) (if ss (command "_move" ss "" "0,0" "-6,0"))) (princ (strcat "\nNo Objects Found in layout " lay)))) (mapcar 'setvar vlst ovar) (princ)) Quote Link to comment Share on other sites More sharing options...
ibnut Posted April 2, 2009 Author Share Posted April 2, 2009 Thanks Lee Mac! After playing around with the first code you posted, I kind of "ghetto-modified" it to get it to do what I needed it to do (luckily all my xrefs were inserted at 0,0). (foreach lay (layoutlist) (setvar "CTAB" lay) (command "_pspace" "move" "window" "0,0" "18.5,11" "" "0,0" "-6,0")) I will definitely try out what you've just posted in case I run into a situation where xrefs were not inserted at 0,0. Thanks! Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted April 2, 2009 Share Posted April 2, 2009 Thanks Lee Mac! After playing around with the first code you posted, I kind of "ghetto-modified" it to get it to do what I needed it to do (luckily all my xrefs were inserted at 0,0). (foreach lay (layoutlist) (setvar "CTAB" lay) (command "_pspace" "move" "window" "0,0" "18.5,11" "" "0,0" "-6,0")) I will definitely try out what you've just posted in case I run into a situation where xrefs were not inserted at 0,0. Thanks! Well, I'm glad you found a solution in the end anyway Quote Link to comment Share on other sites More sharing options...
wakibd Posted May 4, 2009 Share Posted May 4, 2009 Hello Lee, Is there any command that make to move the model sapce to layout space. Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted May 4, 2009 Share Posted May 4, 2009 Hello Lee,Is there any command that make to move the model sapce to layout space. Hello Wakibd If you have a new question, it is much better to create a new thread in the relevant forum, so that the whole community can have a go at answering your query. Lee Quote Link to comment Share on other sites More sharing options...
alanjt Posted May 5, 2009 Share Posted May 5, 2009 Hello Wakibd If you have a new question, it is much better to create a new thread in the relevant forum, so that the whole community can have a go at answering your query. Lee ditto....the command you want is "chspace" Quote Link to comment Share on other sites More sharing options...
wakibd Posted May 5, 2009 Share Posted May 5, 2009 Actually I like to do the following operation. If I model space it should go automitcally paper space and do the following thing.But if the drawing in paper space it ignire first command then it do the following thing. The command you give to me it does not work. If you have anything please let me know (defun c:zqc()(command "chspace") (command "zoom")(command "extents")(command "yes") (command "qsave")(command "close")(command "") ) Quote Link to comment Share on other sites More sharing options...
wakibd Posted May 5, 2009 Share Posted May 5, 2009 Actually I like to do the following operation. If I model space it should go automitcally paper space and do the following thing.But if the drawing in paper space it ignire first command then it do the following thing. The command I have it does not work (defun c:zqc()(command "chspace") (command "zoom")(command "extents")(command "yes") (command "qsave")(command "close")(command "") ) 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.