Jump to content

A Simple Lisp: Plot, Select Printer, Plot Extents, Center the Plot, Click OK


Jim Clayton

Recommended Posts

I do this routine roughly a hundred and 183 thousand times a day and it just occurred to me...why not try to see if I can find a lisp for it so that I can do it with a simple command. Again these are the steps that I'm trying to achieve:

 

 

Plot, Select Printer, Paper Size (11x17), Plot Extents, Center the Plot, Click OK

 

 

Does anyone know of a Lisp that already exists for this type of function or a way of going about creating one?

 

 

For extra credit, all the same functions, but Print to PDF.

Would greatly appreciate any help with this. Thanks.

Link to comment
Share on other sites

Jim,

 

Modify this.

 

 

;;; PrintPDF1824
(defun c:pdf1824 (/ ss mn mx)
     (vl-load-com)
     (if (setq ss  (ssget "_:S:E" '((0 . "INSERT,LWPOLYLINE"))))
         (progn
 (vla-getboundingbox (vlax-ename->vla-object (ssname ss 0)) 'mn'mx)
   (command "plot" "yes" "model" "[color="red"]Your PDF[/color].pc3" "ARCH C (18 x 24 in)"
         "inches" "Landscape" "no" "Window"
         (trans (vlax-safearray->list mn) 0 1)
         (trans (vlax-safearray->list mx) 0 1)
         "fit" "center" "yes" "[color="red"]YOUR.ctb[/color]"  "yes" "no" "no" "yes" "yes")
               )
         )
     )

Link to comment
Share on other sites

Jim,

 

Modify this one. this does multiple copies.

 

 

;;; Printpage24X18
(defun c:prp24 (/ ss mn mx)
     (vl-load-com)
(pltnum)
     (if (setq ss  (ssget "_:S:E" '((0 . "INSERT,LWPOLYLINE"))))
         (progn
 (vla-getboundingbox (vlax-ename->vla-object (ssname ss 0)) 'mn'mx)
   (repeat xplta (command "plot" "yes" "model" "[color="red"]Your.pc3[/color]" "18x24(ARCH C)"
         "inches" "LANDSCAPE" "no" "Window"
         (trans (vlax-safearray->list mn) 0 1)
         (trans (vlax-safearray->list mx) 0 1)
         "fit" "center" "yes" "[color="red"]Your.ctb[/color]"  "yes" "no" "no" "yes" "yes")
               )
         )
     )
  )
(defun pltnum ()
(setq numplt (getint "\nEnter Number of Plots <1>: "))
(if (= numplt nil) (setq xplt 1) (setq xplt numplt))
(if (<= xplt 15) (setq xplta xplt) (setq xplta 15))
) 

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