For the life of me, I can not seem to successfully remove the "for each tab" function, and make this PlotPDF for one tab (current) only.
I thought it would be so simple! Please help me, what am I missing!?
Code:
(defun C:Gen-Plot-Single-PDF (/ savepath tab dname)
(setvar "filedia" 0)
(setq savepath (strcat (getvar "DWGPREFIX") "ProgressPrints\\"))
(setq PathTest (C:Gen-CreateDirectory savepath))
(if (= PathTest T)
(progn
(foreach tab (layoutlist)
(if (= (length (layoutlist)) 1)
(setq dname (strcat savepath (vl-string-subst (strcat " " tab) ".dwg" (getvar "dwgname"))))
(setq dname (strcat savepath (vl-string-subst (strcat "-" tab) ".dwg" (getvar "dwgname"))))
)
(setvar "ctab" tab)
(command "-plot" "y" tab "DWG to PDF.pc3" "" "m" "l" "n" "l" "" "" "y" "" "y" "n" "n" "n" dname "n" "y")
;SOLVE: if theres eror = prompt
)
);progn
(princ "Failed to create folder path. Please create \"ProgressPrints\" file path manually in build folder")
);if
(setvar "filedia" 1)
(princ)
);defun