这是一个模型空间版本,同样适用于布局,它将找到所有标题栏并绘制它们。我个人每个版面1个标题栏。
一旦设置了正确的块名和图纸尺寸等,快速而肮脏的使用CHSPACE和下面的代码就会起作用。
- (PROMPT ".....PRINTING DRAWING TO plotter....")
- (setq oldsnap (getvar "osmode"))
- (setvar "osmode" 0)
- (setq ss2 (ssget "x" '((0 . "INSERT")(2 . "Da1drsht")(410 . "Model")))) ; da1drsht is the name of the title block 410 is the space
- ; for this post remove the (410 . "Model")
- ; and have a (if (/= "model" (getvar "ctab"))
- (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) 6.0))
- (setq ymin (- (caddr inspt) 6.0))
- (setq xymin (strcat (rtos xmin 2 1) "," (rtos ymin 2 1)))
- (setq xmax (+ xmin 813.0)) ; hard coded for 813 wide 6mm offset
- (setq ymax (+ ymin 566.0)) ;hard coded for 566 high
- (setq xymax (strcat (rtos xmax 2 1) "," (rtos ymax 2 1)))
- (COMMAND "-PLOT" "Y" "" "//PRODPRN01/Design-5100"
- "A3" "M" "LANDSCAPE" "N"
- "W" xymin xymax "1=2" "C"
- "y" "Designlaser.ctb" "Y" "" "n" "n"
- "y"
- )
- (setq index (+ index 1))
- )
- (setvar "osmode" oldsnap)
- (princ)
|