Jazzy1988 Posted September 1, 2011 Share Posted September 1, 2011 Is it at all possible to swtich between layout tabs by a command? I'm messing around with a .bat file that creates a script for printing that only prints layout1. The CAD file I'm trying to print has multiple tabs and all tabs have a different name, Lot 02, Lot 03, Lot 04 (not the standard layout1, layout2, etc). Quote Link to comment Share on other sites More sharing options...
BlackBox Posted September 1, 2011 Share Posted September 1, 2011 Consider iterating through the (layoutlist), or get the appropriate Item from the Layouts Collection. Quote Link to comment Share on other sites More sharing options...
BIGAL Posted September 1, 2011 Share Posted September 1, 2011 (setvar "CTAB" "layout1") then plot will do what you want I would use a lisp via findfile to pick drawing name then write a script and then run script to open new drawing and run plot lisp open filename (setvar "CTAB" "layout1") (load "myplotlcurrentlayout") theres a few examples of the code to plot from lisp on the forum heres one anyway to get you started. (COMMAND "-PLOT" "Y" "" "Cutepdf Writer" "A3" "m" "LANDSCAPE" "N" "W" "-6,-6" "807,560" "1=2" "C" "y" "Designlasercolour.ctb" "Y" "n" "n" "y" "N" "N" "y" ) ) Quote Link to comment Share on other sites More sharing options...
BlackBox Posted September 1, 2011 Share Posted September 1, 2011 I'm messing around with a .bat file that creates a script for printing that only prints layout1. The CAD file I'm trying to print has multiple tabs and all tabs have a different name, Lot 02, Lot 03, Lot 04 (not the standard layout1, layout2, etc). (setvar "CTAB" "layout1") then plot will do what you want ... Now I'm just confused. Which is it "layout#", or "Lot ##"? Quote Link to comment Share on other sites More sharing options...
Jazzy1988 Posted September 1, 2011 Author Share Posted September 1, 2011 For my purpose the tabs are named Lot ##. Also, RenderMan I'm not sure what your initial response meant. Quote Link to comment Share on other sites More sharing options...
BIGAL Posted September 2, 2011 Share Posted September 2, 2011 Sorry should have been (setvar "CTAB" "lot 1") Quote Link to comment Share on other sites More sharing options...
irneb Posted September 2, 2011 Share Posted September 2, 2011 Also, RenderMan I'm not sure what your initial response meant.RM meant that the lisp function (layoutlist) returns a list of all the layout names in the current drawing. The alternative is stepping through the ActiveX collection, but that's probably a lot more involved. So say you wanted to plot all the layouts using BigAl's method: (foreach lay (layoutlist) (setvar 'CTab lay) (command "-PLOT" .....) ;This line should be similar to BigAl's post #3 ) That way you need not even worry about what the layout's name is since it simply goes through all of them. Quote Link to comment Share on other sites More sharing options...
BIGAL Posted September 4, 2011 Share Posted September 4, 2011 Like Irnerb thats exactly what the code was cut from a "plot all tabs", the original request was though to open a dwg and plot one tab only say via a script. The simplest way forget .bat is to run a lisp that uses (setq filename (getfiled "Select file to open")) to pick drawing and writes a script the last line in the lisp is (command "script" "plotlot1") this will run the script file that does the plotting. You can write the plot as part of the script if you want rather than run a lisp. Quote Link to comment Share on other sites More sharing options...
Jazzy1988 Posted September 7, 2011 Author Share Posted September 7, 2011 Oh ok. Thanks for the help you have all given me! 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.