본문 바로가기
autocad

선택없이 PDF 출력하기

by kmlab 2024. 7. 24.

KMPLOT_nosel.lsp
0.01MB

 

;;===================PLOT PDF with dwg filename non selection===================== 
;; 
(defun KM:KPDF0 (); KM Plot Script PDF Automatic Search Sheet ;자동으로 시트를 찾아서 출력
;; 
;;set Init 
(KM:INIT) 
;
(setq PdfName (vl-string-subst ".pdf" ".dwg" (getvar "dwgname"))) 
(setq PdfName (strcat (getvar "dwgprefix") PdfName)) ; pdf 이름, 경로는 cad와 동일하게
;
;
(setq lys (list "_TITL" "AA-TITLE" "TITLE")) ; Layers of Sheets. 시트가 배치된 레이어들
;(setq sheetname "Sheet_A1_R*") ; 시트 블럭 이름 첫 10자
;
(setq cnt 0 ly "0")
(while (not (tblsearch "LAYER" (setq ly (nth cnt lys))))
(setq cnt (1+ cnt))
)
(setq drawingbox (ssget "_s" (list (cons 0 "INSERT") (cons 8 ly)))) ; 시트레이어에 있는 블럭 찾기
;
(setq PaperSize "A3")
(KM:PLOTAREA drawingbox PaperSize) 
;
(KM:PLOTSETTING) 

(progn (KM:PLOTLOAD) (KM:PLOTm) (KM:PLOTPROCEED)) 
;; Reset 
(KM:RESET) 

;;success plot 
(prompt "\n...SUCCESS PLOT...\n") 
(princ (strcat PdfName "  " p_scale)) 
(princ) 
;(command "close") 
);defun KP PDF0 printing to path_dwg_filename.pdf 
;; 
(defun c:KP0 () 
(KM:KPDF0) 

반응형