nil return stops script in conditional progn

nil return stops script in conditional progn

Anonymous
Not applicable
599 Views
2 Replies
Message 1 of 3

nil return stops script in conditional progn

Anonymous
Not applicable

Hey all, I'm setting up a conditional statment with a progn action. I'm receiving a nil return on the last conditional statement that is stopping my script. I'm running this as a command in a script for multiple files.

 

Please help!

 

(cond	((vl-string-search name attI)
		(progn
			(command "copybase" "0,0" "al" "")
			(command "erase" "al" "")
			(command "layout" "t" seed (vl-string-trim "_att" (vl-string-trim "sw_" name)))		
			(command "layout" "s" (vl-string-trim "_att" (vl-string-trim "sw_" name)))	
			(command "layout" "d" "layout1" "")
			(command "pasteclip" "0,0")
			(command "-layer" "lo" "0L_TB_TEXT" "")
			(vla-saveas dwg (strcat dirI (vl-string-trim "_att" (vl-string-subst "sht" "sw" name))) ac2007_template)
		);progn end
	);cond

);cond end
0 Likes
600 Views
2 Replies
Replies (2)
Message 2 of 3

hmsilva
Mentor
Mentor

Hi Chris,

 

remove the last enter from

(command "layout" "d" "layout1" "")

and try again...

 

Hope this helps,
Henrique

EESignature

0 Likes
Message 3 of 3

Kent1Cooper
Consultant
Consultant

[By the way, you don't need the (progn) "wrapper" around those functions.  You would need that if the functions were to be performed as the 'then' expression in an (if) function, but not in a (cond)-function condition.  If the first function returns other than nil, it goes ahead and does all other following functions within the same condition, no matter how many, and without the need to collect them into a single function.]

Kent Cooper, AIA
0 Likes