- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
dears
i have codes to print all sheets whit one function which has been name "plotpr". the problem is that i want to make it as a autocad function and dont load it every time i want to use .
the codes are:
; plot all title blocks in model space
; by Alan H
(DEFUN C:PLOTPR()
(PROMPT ".....PRINTING DRAWING TO plotter....")
(setq oldsnap (getvar "osmode"))
(setvar "osmode" 0)
(setq ss2 (ssget "x" '((0 . "INSERT")(2 . "BORDER")(410 . "Model"))))
(SETQ A (GETREAL "\GIVE THE WIDTH OF THE CADR:"))
(SETQ B (GETREAL "\GIVE THE HEIGHT OF THE CADR:"))
(SETQ DD (GETSTRING "\GIVE THE NAME OF PLOTER:"))
(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))
(setq ymin (caddr inspt))
(setq xymin (strcat (rtos xmin 2 1) "," (rtos ymin 2 1)))
(setq xmax (+ xmin A))
(setq ymax (+ ymin B))
(setq xymax (strcat (rtos xmax 2 1) "," (rtos ymax 2 1)))
(COMMAND "-PLOT" "Y" "" DD
"A4" "M" "LANDSCAPE" "N"
"W" xymin xymax "fit" "C"
"y" "monochrome.ctb" "Y" "" "n" "n"
"y"
)
(setq index (+ index 1))
(setvar "osmode" oldsnap))
)
(princ)
thank you for attention
Solved! Go to Solution.