Jump to content

Switching Between Layout Tabs With a Command


Jazzy1988

Recommended Posts

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).

Link to comment
Share on other sites

(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"      )
   )

Link to comment
Share on other sites

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 ##"? :unsure:

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...