Grigs Posted January 24, 2009 Share Posted January 24, 2009 I'm trying to add some code to a lisp routine and I need to be able to switch to the next layout tab. Does anyone have some code that would do that? What I want to happen is, for each Paperspace layout in the drawing, switch to it and run a command, then switch to the next one and run the same command, etc... Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted January 24, 2009 Share Posted January 24, 2009 Try playing around with the LISP function "layoutlist". Quote Link to comment Share on other sites More sharing options...
wizman Posted January 24, 2009 Share Posted January 24, 2009 (edited) hi grigs, is this still related with your page setup? you may have this: [color=navy](foreach x (layoutlist)[/color] [color=navy](setvar 'ctab x)[/color] [color=navy]...........do your command here..............[/color] [color=navy]);end of foreach[/color] Edited January 21, 2013 by SLW210 Code Tags Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted January 24, 2009 Share Posted January 24, 2009 Nice one Wizman, my thoughts exactly. Quote Link to comment Share on other sites More sharing options...
wizman Posted January 24, 2009 Share Posted January 24, 2009 Nice one Wizman, my thoughts exactly. thanks lee, lets just wait for grigs if this is what he needs, i need to go to ofice now, btw, keep up your good work. Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted January 24, 2009 Share Posted January 24, 2009 keep up your good work. Cheers mate, you too Quote Link to comment Share on other sites More sharing options...
Grigs Posted January 26, 2009 Author Share Posted January 26, 2009 I had the foreach and the layoutlist. What I was missing was the "(setvar 'ctab x)". That is what I needed to change tabs. Thanks for all the help. This will speed up when I have to go back to older drawings and reconfigure them for our newer server/plotter. Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted January 26, 2009 Share Posted January 26, 2009 No Probs, glad you got it sorted If you have any more questions, just ask Quote Link to comment Share on other sites More sharing options...
ibach Posted January 21, 2013 Share Posted January 21, 2013 how to add filter to for each... eg for each whose name starts with text string or containing text... Quote Link to comment Share on other sites More sharing options...
MSasu Posted January 21, 2013 Share Posted January 21, 2013 Please check the WCMATCH function. (foreach item (layoutlist) (if (wcmatch item [i]thePatternToCheck[/i]) (progn (setvar "CTAB" item) ... ) ) ) Quote Link to comment Share on other sites More sharing options...
BIGAL Posted January 22, 2013 Share Posted January 22, 2013 Grigs maybe rather than reconfigure why not just have a plot lisp thats what I have it just plots all layouts etc PDF tiff Colour mono A1 A3 etc I just change the plotter network name in the code. had to do that for 64bit. The users just pick it from menu and know which printer it comes out of. Quote Link to comment Share on other sites More sharing options...
ibach Posted January 22, 2013 Share Posted January 22, 2013 Please check the WCMATCH function. (foreach item (layoutlist) (if (wcmatch item [i]thePatternToCheck[/i]) (progn (setvar "CTAB" item) ... ) ) ) Thak you. Ill try putting it in good use. 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.