PLOT TO PDF named after attributes

PLOT TO PDF named after attributes

Gaganpatel
Collaborator Collaborator
769 Views
4 Replies
Message 1 of 5

PLOT TO PDF named after attributes

Gaganpatel
Collaborator
Collaborator

 

Dear Sir,

Please modify the attached lisp file

Create PDF from model but the filename of that should be made up from attributes "MARKNO."

created PDF should be named like this T1-1, T1-2, T1-3

 

Gaganpatel_0-1691680680115.png

 

 

0 Likes
Accepted solutions (1)
770 Views
4 Replies
Replies (4)
Message 2 of 5

ronjonp
Mentor
Mentor

Try this:

;;;This is the lisp routine to Plot the material list to individual PDF files with the job name and the page number
;;;as is does in the Plot Material List button.
;;; plotpdf.lsp
(defun c:plotpdf (/ bn cnt dir e i ml mn mx ob ss)
  (vl-load-com)
  (setq cnt 0)
  (setq dir (getvar "dwgprefix"))
  (if
    (and
      (progn (initget "B")
	     (setq ob (entsel "\nSelect Block/B for SS: "))
	     (cond ((eq ob "B") (setq bn (getstring "\nEnter SS: ")))
		   ((and (eq (type ob) 'list)
			 (vlax-method-applicable-p (vlax-ename->vla-object (car ob)) 'getboundingbox)
		    )
		    (setq bn (cdr (assoc 2 (entget (car ob)))))
		   )
	     )
      )
      (tblsearch "BLOCK" bn)
      (setq ss (ssget "_X" (list '(0 . "INSERT") '(410 . "Model") (cons 2 bn))))
    )
     (progn
       (vla-zoomextents (vlax-get-acad-object))
       (repeat (setq i (sslength ss))
	 (setq ml "Material-List")
	 (setq cnt (1+ cnt))
	 (vla-getboundingbox (vlax-ename->vla-object (setq e (ssname ss (setq i (1- i))))) 'mn 'mx)
	 (command "plot"
		  "yes"
		  "model"
		  "DWG To PDF.pc3"
		  "ISO full bleed A4 (297.00 x 210.00 MM)"
		  "inches"
		  "LANDSCAPE"
		  "no"
		  "Window"
		  (trans (vlax-safearray->list mn) 0 1)
		  (trans (vlax-safearray->list mx) 0 1)
		  "fit"
		  "center"
		  "yes"
		  "monochrome.ctb"
		  "yes"
		  "As Displayed"
		  (strcat dir (getpropertyvalue e "MARKNO."))
		  "no"
		  "yes"
		  "yes"
		  "yes"
	 )
	 (command ".delay" "750")
       )
     )
     (princ "\nNo Blocks Selected: ")
  )
  (princ)
)
0 Likes
Message 3 of 5

Gaganpatel
Collaborator
Collaborator

Working is good

 

Thank you very much sir.

 

one request possible combine pdf on this lisp ???

0 Likes
Message 4 of 5

ronjonp
Mentor
Mentor
Accepted solution

@Gaganpatel wrote:

Working is good

 

Thank you very much sir.

 

one request possible combine pdf on this lisp ???


No can do sorry. Learn the software and use it as it was designed. This is a task that has been solved OOTB for more than 15 years now ( sheet set manager, publish AND plotting from paper space tabs.

 

The task at hand was how people were doing this in the 90's. Why is this still a thing?

0 Likes
Message 5 of 5

Sea-Haven
Mentor
Mentor

Google Ghostscript yes it can combine pdfs back into 1.

 

Yes can be done via lisp.

0 Likes