I am trying to have the user enter a number of filter rows and the filter frame size then depending on the entry have it insert blocks into the drawings according to the amoutn of filter rows. 10 filter rows = 10 blocks. The thing is that every other block is rotated at 60 degrees. I just can not figure out how to have the correct number of blocks show up in the drawing. Currently working correctly are 2, 3, and 4 filter rows so you can use them to see what i am trying to do. The 2" Angled Filter block has to be placed in a support directory search path.
Code:
(defun C:AngFilter ()
(setq angf (getreal "Enter Number of Filter Rows: "));; getting number of filter rows
(setq angftype (getreal "Enter Filter Frame Size (2\"or4\"): "));;getting filter frame size
(setq angfpnt (getpoint "Select Filter placement"));;Select where you want the filter
(setq angfpnt1 (list (-(car angfpnt)1.1065)(-(cadr angfpnt)1.8913)));; setting insertion point of filter rotated at 60 degrees
(if (and(= angftype 2)(= angf 2))
(progn
(command "insert" "2in. Angled Filter" angfpnt1 """""-60");; Inserting filters
(command "insert" "2in. Angled Filter" angfpnt """""");; Inserting filters
)
(progn
(command "insert" "2in. Angled Filter" angfpnt1 """""-60");; Inserting filters
(command "insert" "2in. Angled Filter" angfpnt """""");; Inserting filters
(ang)
)
)
)
;;;;;Setting up Insertion point for filter block
(defun ang ()
(while (and(= angftype 2)(> angf 2))
(setq angfpnt (list (car angfpnt)(-(cadr angfpnt)27.5136)))setting insertion point for the while function
(command "insert" "2in. Angled Filter" angfpnt """""");; Inserting filter
(setq angf (- angf 2)) setting count
)
(setq angf (+ angf 2))
(if(and(= angftype 2)(> angf 3))
(ang1))
)
;;;Setting up insertion point for Rotated filter
(defun ang1 ()
(while (and(= angftype 2)(> angf 3))
(progn
(setq angfpnt1 (list (car angfpnt1)(-(cadr angfpnt1)27.5136)))
(command "insert" "2in. Angled Filter" angfpnt1 """""-60")
(setq angf (- angf 1))
)
)
)
Note: I don't like the way i have written this program it looks choppy and messy to me so feel free to rewrite or reorganize it they way you feel best. ALL help is appreciated.