Quantcast
Viewing all articles
Browse latest Browse all 14319

LISP Help

I've had some help from hmsilva but I didn't want to take all his time in helping me.  I can't seem to get the member to work properly.  I've tried a couple different variations.  I either get the first sheet 5 to run but no others or it skips sheet 5-8 and goes to the not member.  When sheet 5 runs it plots all sheets and applies the layer control to all of them and ignores the other member and not member.

 

In the drawing I have PS tabs labeled "Sheet 1, Sheet 2...skips 3 and 4 then continues 5-13. So 11 in total, of which I need to turn some layers plot off on sheets 5, 6, 7, and 8.  The drawing package is mostly comprised of xrefs.  Im not certain if the issue is the repeat or nth num layouts but that's what I suspect is a conflict.

 

AutoCAD Map 3D 2010
Win7 Pro x64
2 - Intel Xeon X5450
NVIDIA Quadro FX3700
8GB RAM

 

(defun C:PDFPLOT (/ layouts num )
	(setq layouts (layoutlist)); list all paperspace layouts in the drawing
	(setq num 0); zero counter
	(repeat (length layouts); Repeats the plot command on all layouts
		(cond
			((member (nth num layouts) '("sheet 5"))
				(command "-layer" "p" "n" "ER400|A-CTRAY" "p" "n" "ER400|A-EFIXT" "p" "n" "ER400|A-EQPM" "");;turns on/off xref drawing layers for plot
				(command ".-PLOT" "Y" (nth num layouts) "DWG TO PDF.PC3" "ANSI D (34.00 X 22.00 INCHES)" "I" "L" "N" "W" "0,0" "34,22" "1:1" "C" "Y" "Black & White.ctb" "Y" "Y" "N" "N" (STRCAT (GETVAR "DWGPREFIX") (GETVAR "DWGNAME") (GETVAR "CTAB") ".PDF") "N" "Y")
			);;(do what is necessary)
			((member (nth num layouts) '("sheet 6"))
				(command "-layer" "p" "y" "ER400|A-EQPM" "");;turns on/off xref drawing layers for plot
				(command ".-PLOT" "Y" (nth num layouts) "DWG TO PDF.PC3" "ANSI D (34.00 X 22.00 INCHES)" "I" "L" "N" "W" "0,0" "34,22" "1:1" "C" "Y" "Black & White.ctb" "Y" "Y" "N" "N" (STRCAT (GETVAR "DWGPREFIX") (GETVAR "DWGNAME") (GETVAR "CTAB") ".PDF") "N" "Y")
			);;(do what is necessary)
			((member (nth num layouts) '("sheet 7"))
				(command "-layer" "p" "n" "ER400|A-EQPM" "p" "y" "ER400|A-EFIXT" "");;turns on/off xref drawing layers for plot
				(command ".-PLOT" "Y" (nth num layouts) "DWG TO PDF.PC3" "ANSI D (34.00 X 22.00 INCHES)" "I" "L" "N" "W" "0,0" "34,22" "1:1" "C" "Y" "Black & White.ctb" "Y" "Y" "N" "N" (STRCAT (GETVAR "DWGPREFIX") (GETVAR "DWGNAME") (GETVAR "CTAB") ".PDF") "N" "Y")
			);;(do what is necessary)
			((member (nth num layouts) '("sheet 8"))
				(command "-layer" "p" "n" "ER400|A-EFIXT" "p" "y" "ER400|A-CTRAY" "");;turns on/off xref drawing layers for plot
				(command ".-PLOT" "Y" (nth num layouts) "DWG TO PDF.PC3" "ANSI D (34.00 X 22.00 INCHES)" "I" "L" "N" "W" "0,0" "34,22" "1:1" "C" "Y" "Black & White.ctb" "Y" "Y" "N" "N" (STRCAT (GETVAR "DWGPREFIX") (GETVAR "DWGNAME") (GETVAR "CTAB") ".PDF") "N" "Y")
			);;(do what is necessary)
			((not(member (nth num layouts) '("sheet 5" "sheet 6" "sheet 7" "sheet 8")))
				(command ".-PLOT" "Y" (nth num layouts) "DWG TO PDF.PC3" "ANSI D (34.00 X 22.00 INCHES)" "I" "L" "N" "W" "0,0" "34,22" "1:1" "C" "Y" "Black & White.ctb" "Y" "Y" "N" "N" (STRCAT (GETVAR "DWGPREFIX") (GETVAR "DWGNAME") (GETVAR "CTAB") ".PDF") "N" "Y")
			);;(do what is necessary)
		);; cond
	(setq num (1+ num)); Increment counter
	); end repeat
); end
Image may be NSFW.
Clik here to view.

Viewing all articles
Browse latest Browse all 14319

Trending Articles