put the address and file name on the popup window of a virtual printer (foxit reader)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
hi
i have a code that can print what's inside a multi polyline into multi pdf by the dwg to pdf.pc3 but doe to some reasons dwg to pdf.pc3 doesn't work properly as it should be so i tried to use "foxit reader" virtual printer instead but when i run the script in the middle of it the foxit reader want me to input the address and the name of the file,
but i want to make this process automatic and the address and the file name (which the code could generate it) automatically input in the popup window.
thank for helping 🙂
code:
(defun c:FoxitPDF ( / f i s )
(setq f (strcat (getvar 'dwgprefix) (vl-filename-base (getvar 'dwgname))))
(if (setq s (ssget '((0 . "LWPOLYLINE"))))
(repeat (setq i (sslength s))
(apply 'plotwindow (cons f (windowpoints (ssname s (setq i (1- i))))))
)
)
(princ)
)
(defun plotwindow ( f p q )
(if (> (- (car q) (car p)) (- (cadr q) (cadr p)))
(command
"_.-plot"
"_Yes" ; Detailed plot configuration?
"Model" ; Enter Layout Name
"Foxit Reader PDF Printer.pc3" ; Enter an output device name
"" ; Enter Paper Size (User Defined)
"M" ; Enter paper units [Inches/Millimeters] <Millimeters>
"_L" ; Enter Drawing Orientation
"_N" ; Plot Upside Down?
"_W" ; Enter Plot Area
"_non" p "_non" q
"_F" ; Enter Plot Scale
"_C" ; Enter plot offset
"_Y" ; Plot with Style
"." ; Enter plot style table name (none)
"_N" ; Plot with lineweights?
"As Displayed" ; Enter Shade Plot Settings
"_Y" ;Write the plot to a file
(uniquefilename f ".pdf")
"_N" ; Save Changes to page setup
"_Y" ; Proceed with plot
)
(command
"_.-plot"
"_Yes" ; Detailed plot configuration?
"Model" ; Enter Layout Name
"Foxit Reader PDF Printer.pc3" ; Enter an output device name
"" ; Enter Paper Size (User Defined)
"M" ; Enter paper units [Inches/Millimeters] <Millimeters>
"_P" ; Enter Drawing Orientation
"_N" ; Plot Upside Down?
"_W" ; Enter Plot Area
"_non" p "_non" q
"_F" ; Enter Plot Scale
"_C" ; Enter plot offset
"_Y" ; Plot with Style
"." ; Enter plot style table name (none)
"_N" ; Plot with lineweights?
"As Displayed" ; Enter Shade Plot Settings
"_N" ;Write the plot to a file
;(uniquefilename f ".pdfd")
"_N" ; Save Changes to page setup
"_Y" ; Proceed with plot
(uniquefilename f ".pdf")
)
)
)
(defun uniquefilename ( pth ext / fnm tmp )
(if (findfile (setq fnm (strcat pth ext)))
(progn
(setq tmp 1)
(while (findfile (setq fnm (strcat pth "(" (itoa (setq tmp (1+ tmp))) ")" ext))))
)
)
fnm
)
(defun windowpoints ( ent )
( (lambda ( lst ) (mapcar '(lambda ( x ) (apply 'mapcar (cons x lst))) '(min max)))
(mapcar 'cdr (vl-remove-if-not '(lambda ( x ) (= 10 (car x))) (entget ent)))
)
)
(princ)