Jump to content

Need Help about Auto Printing


Maniac0

Recommended Posts

Hello everyone.

I have a model with lots of sheets in it. I want to print all of them in order but printing them manually by selecting every paper as print screen is waste of time.

I just want to speed up this progress. I read some other topics but coudn't understand what to do. I look some guides about ploting but coudn't find answers about my problems. At least someone can guide me to documents I have to look for auto printing those papers please? :)

PrintExample.dwg

Link to comment
Share on other sites

As I figured. There have been other threads posted with this exact same problem but off the top of my head I can't point you at any particular one. Try a search.

Link to comment
Share on other sites

This will do the trick for your DWG.

 

VERY QUICK AND DIRTY CODE!!

 

(defun C:CADTUTOR ( / )
(setq ss (ssget "_X" (list (cons 410 "Model"))))
(sssetfirst nil ss)
(command "PEDIT" "M" "P" "" "Y" "" "J" "" "")

(setq ss (ssget "_X" (list (cons 8 "0")(cons 410 "Model"))))
(sssetfirst nil ss)
(command "PEDIT" "M" "P" "" "C" "")
(setq n 0)
(repeat (sslength ss)
	(setq ensel (ssname ss n))
	(setq ensellength (vlax-curve-getdistatparam ensel (vlax-curve-getendparam ensel)))
		(if (= (fix ensellength) 14100 )
			(setq newlist (cons ensel newlist))
		)
	(setq n (+ n 1))
)

(setq n 0)
(repeat (length newlist)
	(setq ensel (nth n newlist))
	(setq enlist (entget ensel))
	(setq lowerleft (cdr (assoc 10 enlist)))
	(setq upperright (cdr (nth 24 enlist)))
		(command "-PLOT" "Y" "" "DWG TO PDF" "A3" "M" "P" "N" "W" lowerleft upperright "F" "C" "Y" "" "Y" "" n "N" "Y")
	(setq n (+ n 1))
)
(princ)
)

Link to comment
Share on other sites

Here is another but the maratovich solution is a more universal rather than hard coded like this.

 

You will need to change the title block name and the sheet sizes

 

(PROMPT ".....PRINTING DRAWING TO plotter....")
(setq oldsnap (getvar "osmode"))
(setvar "osmode" 0)

(setq ss2 (ssget "x" '((0 . "INSERT")(2 . "Title block name")(410 . "Model"))))
(setq n (sslength ss2))

(setq index 0)
(repeat n
   (setq en (ssname ss2 index))
   (setq el (entget en))
   (setq inspt (assoc 10 el)) ; insertion pt

  (setq xmin (- (cadr inspt) 6.0))
  (setq ymin (- (caddr inspt) 6.0))
  (setq xymin (strcat (rtos xmin 2 1) "," (rtos ymin 2 1)))

  (setq xmax (+ xmin 813.0)) ; hard coded for 813 wide 6mm offset
  (setq ymax (+ ymin 566.0)) ; hard coded for 566 high
  (setq xymax (strcat (rtos xmax 2 1) "," (rtos ymax 2 1)))


 (COMMAND "-PLOT"  "Y"     "" "//PRxxxxx/Design-5100"
       "A3"	"M"     "LANDSCAPE"   "N"
       "W"	  xymin   xymax "1=2"  "C"
       "y"	  "Designlaser.ctb"      "Y"   ""	"n"   "n"
       "y"	
   )
  
 (setq index (+ index 1))

)

(setvar "osmode" oldsnap)
(princ)

 

It is feasible to create layout tabs moving the title block to a layout and using a mview of the objects still in model space. That would allow you to use Publish or in my case my own version of publish.

Edited by BIGAL
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...