Anyone know if LISP can be used to change Page Setup names? The names are
the same in every drawing, so they could be written into a routine if that
would work.
I heard something a while back about the PUBLISH command in 2004. Does this
have any features that might help me out? I can probably get the bean
counters to approve my upgrade if it'll save me 4 hours a week.
Thanks-
Shawn McDonald
A Layout should define just that, a layout with a specific title block, view
ports, etc. A Page Setup defines all the plotting characteristics.
I.e, I may have 5 layouts in a drawing, but they are for 1 layout
representing the overall drawing, then 4 other layouts representing
different views, areas, etc. I also have 5 page setups as follows:
FULL SIZE DRAFT (Plotter)
FULL SIZE FINAL (Plotter)
HALF SIZE DRAFT (Plotter)
HALF SIZE FINAL (Plotter)
11x17 PRINT (Printer)
So, instead of having 25 layouts (5 layouts x 5 printers=25) I have 5
layouts (much easier to manage), and 5 page setups for the output I need.
These setups can easily be exported/imported between drawings, and when
batch plotting, you don't even need to setup to be in the drawing
necessarily, you can use a template drawing w/ page setups, furter
simplifying your life.
"Shawn McDonald" <smcd...@NOSPAMaspectconsulting.com> wrote in message
news:F578773DAD334D3C...@in.WebX.maYIadrTaRb...
Sorry for the long reply, but I want to make sure there's no more confusion.
I've included a walk-through of a typical project below in case there are
any questions. If I'm missing something obvious, it's because I've had no
formal training since R14, and nobody I've ever worked with has been able to
efficiently use Layouts and Page Setups. If I should be able to do
something I can't, I don't know about it for the same reason. I'm pretty
much self-taught in this area.
I have 25 different figures (sheets, pages). 1 layout tab for each figure.
All 25 figures are on 11x17 title blocks, and are identical as far as
plotting is concerned. Each of them can be plotted using one of four page
setups. The page setup names are:
11x17-Landscape-BI-Black
11x17-Landscape-BI-Color
11x17-Landscape-PDF-Color
11x17-Landscape-SEA-Color
BI is our home office (Bainbridge Island)
--Black is an HP Laserjet 5000
--Color is an HP 1055CM+
SEA is our Seattle office (45 minutes via ferry)
--Color is a SAVIN color laser printer
PDF is the PDF layout
All I need is a way to automate changing all Layouts from "11x17-BI" to
"11x17-SEA" without opening each sheet individually. With regen time, etc.
it takes up to 30 minutes to do this- and is my most redundant, mind-numbing
task.
The page size/orientation is included in the page setup name because some
drawings have more than one title block size (larger DWGs with 10+ figs stay
one size/orientation). I have 16 different title block sizes (ANSI
A,B,C,D,E and ARCH E portrait and landscape, and 11x26,30,36,42 for long
x-sections). Each of these has 2-4 Page Setup Names. The different Page
Setups all have the appropriate CTB, XY Origin, and sometimes Scale settings
(ie- 22x34x.5 for printing D size to 11x17). A print from any printer comes
out with even edges and a binding edge to the right or top (11" sizes) or
centered on the page (ANSI C and up).
If you want to know more of what I do and why, read on.
We're an Environmental Consulting firm. One of our typical drawing sets
shows contaminant levels for specific wells. The site that most recently
gives me this headache has 20 wells with 25 different contaminants. Each
contaminant is it's own figure. Using LD3/Civil3's Point tools, I import
each contaminant value and place it by the well directly from an Access
Database query. Using an extra layout with all contaminants unfrozen, I
fine-tune the placement. Effectively, I've reduced what once was a 24 hour
job to a little over an hour. Now I have to make test-plots. I plot
everything to our BI office on the slow (1 page every 1.5 minutes) HP
1055CM+. Everything's setup, I just highlight all layouts, hit plot, and
get a cup of coffee. My machine is done, and the plotter is chugging away
by the time I get back to my desk.
Next day. Everything looks good, a couple minor edits, and time for
production. We need 25 copies of the report. The HP 1055CM+ will do it in
about 8 hours (and every copy is curled from the roll). The SAVIN will
finish in about 30 minutes (28 copies a minute) including transmission via
DSL line, on nicely pre-cut paper. Much nicer product, not a bad system.*
Problem is, to change to the Seattle printer, I have to switch to each
layout, then "Page Setup-Page Setup name" on each page. If I highlight all
layouts at once- Page Setup is grayed out. If I highlight all and "Plot"
the page setup name is grayed out in the plot DB. Don't know why Autodesk
disallows these functions, but they do. The process adds 20-30 minutes each
time I need to change printers. All I need is a way to automate changing
all Layouts from "11x17-BI" to "11x17-SEA"
*I know we should have the Color Laser this side, but they're not going to
give it up. They want to 'integrate' the two offices, which is great,
except when it comes to production. Especially with all the last minute
stuff we do.
"Martin Schmid" <martin...@sbcglobal.net.nospam> wrote in message
news:EF92DBCB887B5FA1...@in.WebX.maYIadrTaRb...
Try this out
; Jason Piercey . May 16th, 2003
; assign a pagesetup to a layout
; [layout] - string, layout name
; [setup] - string, pagesetup to assign
; return: T or nil
(defun putPagesetup (layout setup / layouts plots)
(defun item-p (collection item)
(if
(not
(vl-catch-all-error-p
(vl-catch-all-apply
'(lambda () (setq item (vla-item collection item))))))
item
)
)
(and
(or *acad* (setq *acad* (vlax-get-acad-object)))
(or *doc* (setq *doc* (vla-get-activedocument *acad*)))
(setq layouts (vla-get-layouts *doc*))
(setq plots (vla-get-plotconfigurations *doc*))
(setq layout (item-p layouts layout))
(setq setup (item-p plots setup))
(not (vla-copyfrom layout setup))
)
)
to assign a single pagesetup to all layouts in a drawing file
you can do this:
(foreach x (layoutlist) (putPagesetup x "yourPagesetupName")
--
-Jason
Member of the Autodesk Discussion Forum Moderator Program
"Shawn McDonald" <smcd...@NOSPAMaspectconsulting.com> wrote in message
news:F578773DAD334D3C...@in.WebX.maYIadrTaRb...
> Anyone know if LISP can be used to change Page Setup names? The names are
The easiest way to get your hard copies: Use batch plot.
1. Open batch plot.
2. Select Add Drawing from the menu/toolbar
3. Shift/Ctrl Click to select all the drawings
4. After all drawings have been added, highlight all files in the Drawing
File list.
5. Select the layouts button, and select "All Layouts" (at this step, you
could pick individual layouts for a given dwg file if you needed to, instead
of All)
6. Select the page setups button, and select what ever setup you want to
use, i.e. "11x17-Landscape-BI-Black" (it can be from ANY file)
7. Save your batch
8. Hit the plot button.
Now you have sent 500 (25x20) sheets to "11x17-Landscape-BI-Black"
Now, say you need to send this same output to 11x17-Landscape-SEA-Color:
1. Open the batch file (if it isn't already):
2. Highlight all the drawing files
3. Hit the Page Setups button, then select "11x17-Landscape-SEA-Color" from
one of your files.
4. Hit plot.
Now you have 500 color plots at the Seattle office.
I hope this makes sense...
MS
"Shawn McDonald" <smcd...@NOSPAMaspectconsulting.com> wrote in message
news:6E42428F9DAAFF9A...@in.WebX.maYIadrTaRb...
*Cancel*
too few arguments
I think part of the problem is understanding what to do with this:
>to assign a single pagesetup to all layouts in a drawing file
>you can do this:
>(foreach x (layoutlist) (putPagesetup x "yourPagesetupName")
It seems that's an instruction for me, but I'm afraid I can't figure out
what it says. I'm fairly LISP illiterate- I've never even known anyone who
used it I'm afraid. Sorry-
Shawn McDonald
"Jason Piercey" <Jason@AtrEngDotCom> wrote in message
news:A36B59AE8B0659BA...@in.WebX.maYIadrTaRb...
The problem with batch plot is it doesn't allow me to send multiple copies.
Often times I need to print 25 copies of each figure. Using batchplot only
sends one sheet at a time. If I want 25 copies, I need to send the file 25
times, and I'd tie the printer up for hours (625 plots processed
individually), so that's not an option here. But thanks-
Shawn
"Martin Schmid" <martin...@sbcglobal.net.nospam> wrote in message
news:8FA53036814A7936...@in.WebX.maYIadrTaRb...
(defun massoc (key alist / x nlist)
(foreach x alist
(if (eq key (car x))
(setq nlist (cons (cdr x) nlist))
)
)
(reverse nlist)
)
; Return: list of all pagesetups defined in the current drawing or nil
(defun getPagesetups ()
(massoc 3 (dictsearch (namedobjdict) "Acad_PlotSettings"))
)
; Jason Piercey . May 19th, 2003
; assign pagesetup to layout(s)
; LIMITED testing
; written for Shawn McDonald
(defun c:psetup (/ lst page res)
(setq lst (mapcar 'strcase (getPagesetups)))
(while (not page)
(setq page (strcase (getstring "\nspecify pagesetup to apply: ")))
(if (or (= "" page) (not (member page lst)))
(progn (princ "\npagesetup not found") (setq page nil))
)
)
(initget "All Current")
(if
(not
(setq
res
(getkword
"\n[All/Current]apply pagesestup to which layout(s) <all>: ")))
(setq res "All")
)
(if (= "All" res)
(foreach x (layoutlist) (putPagesetup x page))
(putPagesetup (getvar "ctab") page)
)
(princ "\nFinished")
(princ)
)
--
-Jason
Member of the Autodesk Discussion Forum Moderator Program
"Shawn McDonald" <smcd...@NOSPAMaspectconsulting.com> wrote in message
news:734D07B9DC7EEEC6...@in.WebX.maYIadrTaRb...
change this line
(setq page (strcase (getstring "\nspecify pagesetup to apply: ")))
to
(setq page (strcase (getstring T "\nspecify pagesetup to apply: ")))
and you are welcome.
--
-Jason
Member of the Autodesk Discussion Forum Moderator Program
"Shawn McDonald" <smcd...@NOSPAMaspectconsulting.com> wrote in message
news:D808CB62BD1B9F40...@in.WebX.maYIadrTaRb...
> Jason- this works great so far, thanks. I'll have to rename my Page Setups
> without spaces to work with the command line, but that's a small price ot
> pay considering all the time this will save. Thanks much-
Shawn McDonald
"Jason Piercey" <Jason@AtrEngDotCom> wrote in message
news:190F957D43AC24D4...@in.WebX.maYIadrTaRb...
"Jason Piercey" <Jason@AtrEngDotCom> wrote in message
news:8A7A5E70E1ED53A6...@in.WebX.maYIadrTaRb...
--
-Jason
Member of the Autodesk Discussion Forum Moderator Program
"Shawn McDonald" <smcd...@NOSPAMaspectconsulting.com> wrote in message
news:DF2542C9B92F2E27...@in.WebX.maYIadrTaRb...
> Wow, even better- thanks!
I downloaded a free trial version from the net and was so impressed I soon
registered.
http://www.fineprint.com/
"Shawn McDonald" <smcd...@NOSPAMaspectconsulting.com> wrote in message
news:DF2542C9B92F2E27...@in.WebX.maYIadrTaRb...
Autodesk... has this feature been added since Acad2000, i.e., is it in 2004?
Thanks,
MS
"Shawn McDonald" <smcd...@NOSPAMaspectconsulting.com> wrote in message
news:66CF4D79E9FB02A7...@in.WebX.maYIadrTaRb...
I do not have LDD to test this with, but all works fine on
AutoCAD 2002. If you sepcify "Current" does it work?
Out of curiosity if you type in (layoutlist) at the command
line what is returned?
--
-Jason
Member of the Autodesk Discussion Forum Moderator Program
"keithbiggs" <kbi...@binnie.com> wrote in message news:f1647...@WebX.maYIadrTaRb...
> Jason:
> I cut and paste your code into a text file, saved it as "psetup.lsp". When I run it I encounter the following error:
>
> Command: PSETUP
>
> specify pagesetup to apply: TEMP
>
> [All/Current]apply pagesestup to which layout(s) : A
> ; error: Automation Error. Invalid object type
>
> BTW, I am using LDD R2 and do not have any experience with LISP coding.
>
> Thanks
>
> Keith
>
>
Yes, current does work. When I type (layoutlist) at the command line, the
named layouts are displayed at the command line as follows:
Command: (layoutlist)
("00-Cover" "01-SS1" "02-R1" "02-XS1" "03-XS2" "11 X 17 (Land) at 500"
"11x17
STM Management Plan" "Model")
Keith
"Jason Piercey" <discussio...@autodesk.com> wrote in message
news:EAD6E5312A5D55B5...@in.WebX.maYIadrTaRb...
(foreach x (layoutlist) (putPagesetup x page))
with this
(foreach x (vl-remove "Model" (layoutlist)) (putPagesetup x page))
--
-Jason
Member of the Autodesk Discussion Forum Moderator Program
"Keith Biggs" <bur...@binnie.com> wrote in message
news:D415D3A8431217C0...@in.WebX.maYIadrTaRb...
Command: (layoutlist)
("4.2 Site" "5.2 SVS Locs" "5.3 GS Area" "5.5 SB Loc" "6.13 SVS VOC"
"6.14
SS Locs" "6.15 TPH Soil" "6.36 TPH GW" "6.5 CS Loc" "Site + Wells")
Could the presence of the "model" tab in layoutlist be throwing a wrench in
the works (for Keith), since a layout Page Setup can't be applied to Model
Space?
"Keith Biggs" <bur...@binnie.com> wrote in message
news:D415D3A8431217C0...@in.WebX.maYIadrTaRb...
(I really need to learn LISP)
-Shawn
"Shawn McDonald" <smcd...@NOSPAMaspectconsulting.com> wrote in message
news:8BDF341C2940AB51...@in.WebX.maYIadrTaRb...
Thanks for the help.
Keith
"Jason Piercey" <Jason@AtrEngDotCom> wrote in message
news:D96DD0165A150410...@in.WebX.maYIadrTaRb...
--
-Jason
Member of the Autodesk Discussion Forum Moderator Program
"Keith Biggs" <bur...@binnie.com> wrote in message news:F3DA021A63F84E29...@in.WebX.maYIadrTaRb...