I want to make the following list selection.
For example, when you enter the command, page size, scale, plot style etc. can you help? Batch to create pdf in one go.

(defun c:plot_pdf (/ bas dwg file hnd i len llpt lst mn mx ss tab urpt)
(if (setq ss (ssget "_X" '((0 . "INSERT") (2 . "SHEET"))))
(repeat (setq i (sslength ss))
(setq hnd (ssname ss (setq i (1- i)))
tab (cdr (assoc 410 (entget hnd)))
bas (cdr (assoc 10 (entget hnd))) ; get insert base point
lst (cons (cons tab (cons bas hnd)) lst) ; include insert base point
; (setq lst (vl-sort lst '(lambda (x y) (> (car x) (car y)))))
; sort by blocks insert base point x ascending = from left right
(setq lst (vl-sort lst '(lambda (x y) (> (car (cadr y)) (car (cadr x))))))
; sort by blocks insert base point y descending = from top down
(setq lst (vl-sort lst '(lambda (x y) (< (cadr (cadr y)) (cadr (cadr x))))))
(setq i 0)
(foreach x lst
(setq file (strcat (getvar 'DWGPREFIX)
(substr (setq dwg (getvar 'DWGNAME)) 1 (- (strlen dwg) 4))
(itoa (setq i (1+ i)))
(if (findfile file)
(vl-file-delete file)
; (vla-getboundingbox (vlax-ename->vla-object (cdr x)) 'mn 'mx)
(vla-getboundingbox (vlax-ename->vla-object (cddr x)) 'mn 'mx)
(setq llpt (vlax-safearray->list mn)
urpt (vlax-safearray->list mx)
len (distance llpt (list (car urpt) (cadr llpt)))
(command "-plot"
(car x)
; "ISO A3 (420.00 x 297.00 MM)"
; "ISO A1 (841.00 x 594.00 MM)"
"ISO full bleed A4 (297.00 x 210.00 MM)"
; "1:10"
; "grayscale.ctb"
; "Screening 75%.ctb"
(if (/= (car x) "Model")
(command "No" "No" file "no" "Yes") ; pspace
(command file "no" "Yes") ; model


  • A question.

    Are the title blocks in Model space or in layouts ?

    Yes I have
    Plot all titles in modelspace
    Plot range layouts
    Plot various size tiles in layouts, note must be customised for a client

    Google "Plotting by Maratovich" very powerful program lots of features.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!