Can't get fillet command to work in routine

Can't get fillet command to work in routine

Anonymous
Not applicable
734 Views
1 Reply
Message 1 of 2

Can't get fillet command to work in routine

Anonymous
Not applicable

 

(defun C:fp(/ counter choice)

	; Generate Walls
	(setq counter 0)
	(setq choice "Yes")
	(while (= choice "Yes")
		(+ counter 1)
		(princ "\nPick Points/Enter Length of the wall: ")
		(command "Line" pause pause "")
		(command "._offset" (getreal "\nEnter Wall Thickness: ") (entlast) pause "")
		(initget 1 "Yes No")
		(setq choice (getkword "\nWould you like to draw another wall? [Yes/No]: "))
	)
	(if (> counter 2)
		(repeat counter
			(command "._fillet" (princ "\nSelect the Objects You'd like to Fillet: ") pause pause "")
		)	
	)
)

 

I'm wanting the fillet command to run for as many times as the counter. can't get it working. probably just a dumb mistake. 

0 Likes
735 Views
1 Reply
Reply (1)
Message 2 of 2

Kent1Cooper
Consultant
Consultant

First thing I notice:

 

(+ counter 1)

 should be

(setq counter (+ counter 1))

because what you have will only return the value, but won't put it into the variable.

 

I would also be inclined to change this prompt:

 

"\nPick Points/Enter Length of the wall: "

because the way it's worded suggests one could type in a number for the Length, but that won't work right with the following code.

 

Also, consider setting the FILLETRAD System Variable to 0 first, or building the setting of it into the Fillet command part, in case some other value might be current when you run this.

Kent Cooper, AIA
0 Likes