Jump to content

Plot paper sizes in lisp routine


blaws

Recommended Posts

I've created a very basic lisp routine to run which automates us issuing drawings (Binding x-refs, removing draft stamp, etc). The only issue I'm having is getting it to automatiaclly PDF correctly. I've copied below the two lines i've used to try and solve it. All the layouts are set up correctly as standard. When going through the plot dialogue menu, no settings have to be altered for it to plot correctly. This is how I initially wrote the command;

 

(command "plot" "" "" "" "CutePDF Writer" "" "" "")

 

This one works on all A3 drawings but anything other that that the page size ends up being seemingly A4 or Letter, and it gets altered from Landscape to Portrait.

 

The second go I used this;

 

(command "plot" "Y" "" "CutePDF Writer" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "" "")

 

So this time I am accessing the detailed plot config, but again entering through all the options as initiaially they all looked ok.

 

I've now noticed the problem is that when going through the detailed menu, the paper size is defaulted to either Letter or A4, despite the fact that the layout default is A1 (or whatever).

 

How can I get around this?

Link to comment
Share on other sites

I suggest you to create a PC3 file (from Print command dialog) for each setup you have and after apply it according to current sheet.

 

Regards,

Mircea

Link to comment
Share on other sites

Why not supply the paper size within your routine? I create a script to plot our drawings and ours looks like this...

 

plot
y
Layout1
DWG to PDF.pc3
ISO A3 (420.00 x 297.00 MM)
m
l
n
e
F
C
y
STL Mono.ctb
y
n
n
n
"p:\Design_Office\E106\E106-41\BOL Renumber\BOL-41-BD-0038-01.dwg.PDF"
n

 

this will plot to a file, you should be able to see the similarities

Link to comment
Share on other sites

Same thing in lisp theres another post where code was added to select paper size but still plot all now where is it.

 

(PROMPT ".....PRINTING DRAWING TO pdf's....")
(setvar "cmddia" 0)
(setvar "filedia" 0)
(setq doc (vla-get-activedocument (vlax-get-acad-object)))
(vlax-for lay (vla-get-Layouts doc)
 (setq plotabs (cons (vla-get-name lay) plotabs))
)
(setq plottablist (acad_strlsort plotabs))
(setq len (length plottablist))
(setq x 0)
(repeat len
 (setq name (nth x plottablist))
 (princ name)
 (if (/= name "Model")
   (progn
     (setvar "ctab" name)

     (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"      )
   )
 )
 (setq x (+ x 1))
)
(setvar "cmddia" 1)
(setvar "filedia" 1)
(princ)

Link to comment
Share on other sites

Cheers for the advice. I've spoken to a few people around the office who have now sais they'd prefer it if it just brought the plot dialogue box up so they can decide how to print it. Fair enough. problem is, why doesnt (command "plot") do that? I've tried _plot and ._plot but neither seem to do anything?

Link to comment
Share on other sites

I've got another one that I might as well drop into this thread.

 

Why wont this work as a single routine;

(defun layer253 (which)

(command "-layer" "c" "253" "BCC_E_L*"

)

The command sequence works fine but when I try to run it it just says 'no function definition'. What have I missed?

Link to comment
Share on other sites

1st thing count your brackets your missing one

 

maybe this as a global defun put it in your startup and then it can be called from any other routine


preset variables
(setq which "DESIGN")
(setq col "253")

call defun layercol
(layercol which col)


defun required
(defun layercol (which col)
(command "-layer" "c" col which "")
)

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