;TIP598B.LSP Draw Channel Section ;revised (defun C:CHNNL2 (/ CHFL CHD DLN CTL OS ) (setq CHD (strcase (getstring "Channel size, ie 12x30: ") T) CHFL (open "C:/ACAD/LISP/CHNNL.TXT" "r") DLN (strlen CHD) CTL (read-line CHFL) ) (while (and CTL (/= CHD (substr CTL 1 DLN))) (setq CTL (read-line CHFL)) ) (close CHFL) (if (not (member CTL '(nil ""))) (if (= CHD (substr CTL 1 DLN)) (DRCHN CTL) ) (prompt "Channel size not found\n") )(princ) ) (defun DRCHN (CTL) (setq IP (getpoint "Pick insertion point ") DIS (* 0.08748 (/ (- BF TW) 2)) NTH (/ pi 2) WST pi STH (* 3 (/ pi 2)) EST 0.0 PT1 (polar IP NTH BF) PT2 (polar PT1 EST D) PT3 (polar PT2 STH BF) PT4 (polar PT3 WST (- TF DIS)) PTA (polar PT2 STH TW) PT5 (polar PTA WST (+ TF DIS)) PTB (polar PT1 STH TW) PT6 (polar PTB EST (+ TF DIS)) PT7 (polar IP EST (- TF DIS)) ) (command "PLINE" IP PT1 PT2 PT3 PT4 PT5 PT6 PT7 IP "") (command "FILLET" "R" (- (- TF DIS) 0.001)) (command "FILLET" PT4 PT4) (command "FILLET" PT7 PT7) (command "FILLET" "R" "0.125") (command "FILLET" PT5 PT5) (command "FILLET" PT6 PT6) )