- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi there.
i'm using plot lisp routine below.
(defun c:pazpdf ( / 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 )
(command
"_.-plot"
"_Yes" ; Detailed plot configuration?
"Model" ; Enter Layout Name
"DWG To PDF.pc3" ; Enter an output device name
"User 1 (867.00 x 620.00 MM)" ; Enter Paper Size (User Defined)
"_M" ; Enter paper Units
"_L" ; Enter Drawing Orientation
"_N" ; Plot Upside Down?
"_W" ; Enter Plot Area
"_non" p "_non" q
"1:1" ; Enter Plot Scale
"_C" ; Enter plot offset
"_Y" ; Plot with Style
"Pazarcık.ctb" ; Enter plot style table name (none)
"_Y" ; Plot with lineweights?
"As Displayed" ; Enter Shade Plot Settings
(uniquefilename f ".pdf") ; this line is pdf file name, if you use it, remove the comma from the start
;"_N" ; Write the plot to a file (if you convert to pdf, this line wil be deleted...)
"_N" ; Save Changes to page setup
"_Y" ; Proceed with plot
)
)
(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)
i must select the outer polylines by bottom-right to top-left then it plot to opposite sort like top-left to bottom-right.
that's okey no problem for me. it's working like a charm about many years 🙂
then i think it's should be more useful like plot all sheets one-click.
i do search google about selection sort properties. i've find it out one then i customize a little bit. like below:
;SANIRIM OLDU !!!!!
(defun c:eaa ( / ss lst i )
(setq ss (ssget '((0 . "LWPOLYLINE") (8 . "PLOTLINE"))))
(repeat (setq i (sslength ss))
(setq lst (cons (ssname ss (setq i (1- i))) lst)))
(setq lst (vl-sort lst (function (lambda (x y) (< (cadr (assoc 10 (entget x)))
(cadr (assoc 10 (entget y)))))))
lst (vl-sort lst (function (lambda (x y) (> (caddr (assoc 10 (entget x)))
(caddr (assoc 10 (entget y))))))))
(command "pline")
(foreach e lst (command "_none" (cdr (assoc 10 (entget e)))))
(command)
(princ)
)
its sorted plines (top-left to bottom-right) about selected with window method one click.
problem is here because i do not know about autolisp well to combine them.
now i need a lisp routine like that:
i will select all polylines by window method then it's will plot first top-left to bottom right.
thanks for advance.
Solved! Go to Solution.