Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Plot all layouts using Script

14 REPLIES 14
Reply
Message 1 of 15
Anonymous
1034 Views, 14 Replies

Plot all layouts using Script

We use script routines for all our printing. Is there a way of selecting all of the layouts on a drawing using script so that they can be printed.
Thanks in advance.
John
14 REPLIES 14
Message 2 of 15
Anonymous
in reply to: Anonymous

Isn't there a check box in the plot dialog to plot
all layouts?


style="BORDER-LEFT: #000000 2px solid; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px; PADDING-LEFT: 5px; PADDING-RIGHT: 0px">
We
use script routines for all our printing. Is there a way of selecting all of
the layouts on a drawing using script so that they can be printed.
Thanks
in advance.
John
Message 3 of 15
Anonymous
in reply to: Anonymous

That doesn't help when you are using a script. Script files are all
command line.

-Jason

Brent Upton wrote:
>
> Isn't there a check box in the plot dialog to plot all layouts?
>
> JohnAlex wrote in message
> news:f05d048.-1@WebX.maYIadrTaRb...
> We use script routines for all our printing. Is there a way
> of selecting all of the layouts on a drawing using script so
> that they can be printed.
> Thanks in advance.
> John
Message 4 of 15
Anonymous
in reply to: Anonymous

John:

 

How about just copying and pasting the whole mess
to the end of the file and changing the Layout part of the script for each
layout.  I do that in my sets since it seems every sheet requires some
goofy personal set up items. 

 

Or, could one select more than one layout in that
place?  I don't know. . One may

 

;;example below

 -PLOT
YES

;Following is layout selected.
L-1-LP1
HP
DeskJet 1220C Printer
Tabloid (11 x 17 in.)
Inches
etc. 

 

Good luck, let us know out here in cyber space what
you find.

 

Matt Fridell

saladays@gwtc.net


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
We
use script routines for all our printing. Is there a way of selecting all of
the layouts on a drawing using script so that they can be printed.
Thanks
in advance.
John
Message 5 of 15
Anonymous
in reply to: Anonymous

Possible strategy

1.  Make sure prior to plotting that you have used pagesetup on each
layout to get the settings right.  This simplifies each plot task.

2.  Have the script call the following function

 

;Function to plot all tabs in a drawing
;To work correctly, each tab
must have had PAGESETUP performed prior to
;calling plotalltab
;To plot
all layouts including model space (plotalltab t)
;To plot just paperspace
layouts (plotall nil)

 

(defun plotalltab ( model / n l) ;DC Broad 6-20-01  For A2K
 
(setq l (layoutlist))
  (setq l (if model (cons "model" l) l))
 
(foreach n l
   (command "-plot" "yes" n )
   
;and adapting some code posted earlier today to allow for a variable number of
returns
  (while (= (logand (getvar "CMDACTIVE") 1)
1)
    (command "") ;pagesetup must have been performed
or this is pot luck.
  ) ;_ end while
);end foreach
);end
plotalltab

Hope that helps.


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
We
use script routines for all our printing. Is there a way of selecting all of
the layouts on a drawing using script so that they can be printed.
Thanks
in advance.
John
Message 6 of 15
Anonymous
in reply to: Anonymous

How about this in your script:

(foreach tab (vl-remove "Model" (layoutlist))
(setvar "ctab" tab)
(command "-plot" etc. etc...)
)
--

Regards,
Eric S.
eschneider@jensenprecast.com
Message 7 of 15
Anonymous
in reply to: Anonymous

Don't think you need vl-remove. Since (layoutlist) doesn't include "model"
in the list but you pointed out a major flaw in mine. OOPS! A revision
follows.

;Function to plot all tabs in a drawing
;To work correctly, each tab must have had PAGESETUP performed prior to
;calling plotalltab
;To plot all layouts including model space (plotalltab t)
;To plot just paperspace layouts (plotall nil)

(defun plotalltab ( model / n l) ;DC Broad 6-20-01 For A2K
(setq l (layoutlist))
(setq l (if model (cons "model" l) l))
(foreach n l
(setvar "ctab" n) ;oops this was forgotten in first post.
(command "-plot" "yes" n )
;and adapting some code posted earlier today to allow for a variable
number of returns
(while (= (logand (getvar "CMDACTIVE") 1) 1)
(command "") ;pagesetup must have been performed or this is pot luck.
) ;_ end while
);end foreach
);end plotalltab

Thanks for spotting it Eric.
Doug Broad

"Eric S." wrote in message
news:1009A3770590A81D830C4260B6F245E3@in.WebX.maYIadrTaRb...
> How about this in your script:
>
> (foreach tab (vl-remove "Model" (layoutlist))
> (setvar "ctab" tab)
> (command "-plot" etc. etc...)
> )
> --
>
> Regards,
> Eric S.
> eschneider@jensenprecast.com
>
>
Message 8 of 15
Anonymous
in reply to: Anonymous

(layoutlist) _may_ return "Model" at times. It is a noted bug (at least here
in the ng).

--
http://www.acadx.com


"Doug Broad" wrote in message
news:FD033FE0BF2E45265B71820CAB101DA8@in.WebX.maYIadrTaRb...
| Don't think you need vl-remove. Since (layoutlist) doesn't include "model"
| in the list but you pointed out a major flaw in mine. OOPS! A revision
| follows.
Message 9 of 15
Anonymous
in reply to: Anonymous

Thanks for correcting me. I hadn't learned of that bug. Still new to
monitoring this NG. I tested (layoulist) several times last night and
today and during those tests it did not return "model." Wish the "noted"
bugs were a little more accessible.

"R. Robert Bell" wrote in message
news:99DE9DFDB1C4B82FC558275699E09D53@in.WebX.maYIadrTaRb...
> (layoutlist) _may_ return "Model" at times. It is a noted bug (at least
here
> in the ng).
>
Message 10 of 15
Anonymous
in reply to: Anonymous

It's quite alright. They may have even fixed it by A2k2.

--
http://www.acadx.com


"Doug Broad" wrote in message
news:CF835FB50DDAD2906B8C36ADB1783965@in.WebX.maYIadrTaRb...
| Thanks for correcting me. I hadn't learned of that bug. Still new to
| monitoring this NG. I tested (layoulist) several times last night and
| today and during those tests it did not return "model." Wish the "noted"
| bugs were a little more accessible.
|
| "R. Robert Bell" wrote in message
| news:99DE9DFDB1C4B82FC558275699E09D53@in.WebX.maYIadrTaRb...
| > (layoutlist) _may_ return "Model" at times. It is a noted bug (at least
| here
| > in the ng).
| >
|
|
|
Message 11 of 15
Anonymous
in reply to: Anonymous

Thank you everybody for the help.
I'll play around with these. Good thing is that I can probaly use these for other commands to do with the layouts. Import pagesetups using -psetupin etc.
Thanks
P.S. What will I do about AutoCAD LT
Message 12 of 15
Anonymous
in reply to: Anonymous

Dump it, and get a real environment to program in, BwaHaHa!

--
http://www.acadx.com


"JohnAlex" wrote in message
news:f05d048.9@WebX.maYIadrTaRb...
| Thank you everybody for the help.
| I'll play around with these. Good thing is that I can probaly use these
for other commands to do with the layouts. Import pagesetups using -psetupin
etc.
| Thanks
| P.S. What will I do about AutoCAD LT
|
Message 13 of 15
Anonymous
in reply to: Anonymous

I second that.

"R. Robert Bell" wrote in message
news:28F2246A2D208051416AC79C6D284301@in.WebX.maYIadrTaRb...
> Dump it, and get a real environment to program in, BwaHaHa!
>
> --
> http://www.acadx.com
>
>
Message 14 of 15
Anonymous
in reply to: Anonymous

Throw your arms up in dispair. :^( No VLISP interperiters available. You
could write the code in VB(a), but that's a different news group. ;^)
--

Regards,
Eric S.
eschneider@jensenprecast.com
Message 15 of 15
Anonymous
in reply to: Anonymous

> (layoutlist) _may_ return "Model" at times. It is a noted bug (at least here
> in the ng).

Haven't tested this in a recent MDT version but in MDT4.0 when starting a
new drawing "from scratch" or using a template (don't recall which),
this would then show the model tab with (layoutlist).

--
Sincerely,
Darren J. Young

Minnesota CADWorks, Inc.
P.O. Box 7293
Saint Cloud, Minnesota 56302-7293
Phone: (320) 654-9053
WWW: http://www.mcwi.com

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

”Boost