;------------------------------------------------ ANGLES.LSP ------------------- ; ; ANGLES.LSP Copyright 1990 Cerro Metal Products ; P.O. Box 144 ; Bellefonte, Pa. 16823 ; Phone 814-355-7307 ; Fax 814-355-6227 ; ; Written by: Walter Mehalko ; ; Notice: ; ; ANGLES.LSP is being provided as a courtesy of Cerro Metal Products for the ; benefit of the users of AutoCad, and is intended for non-commercial, ; non-profit use only. If your have any other intentions, contact the author ; at the phone number listed above. I am very gullable and will probably ; agree to almost anything you have in mind, provided that you consult ; me first. ; ; Do not redistribute this file with any portion of it removed and/or altered. ; The only reason that I ask this of you is so that anyone who stumbles over ; it can find out where to get help if needed. ; ; ANGLE PROGRAM ; DRAWS ANGLES BASED ON USER INPUT ; CERRO METAL PRODUCTS ; REVISION 1.0 ; DATE 4-07-89 ; WALT MEHALKO (defun angerr (s) (if (/= s "Function cancelled") (princ (strcat "\nError: " s)) ) (command "setvar" "blipmode" oldb "undo" "e" "setvar" "cmdecho" olde) (setq *error* olderr oldb nil olde nil olderr nil) (princ) ) (defun C:ANGLES (/ olderr s1 s2 tk ip ang p2 p3 p4 p5 p6 p7 p8 p9 oldb olde) (setq olderr *error* *error* angerr) (initget 6) (setvar "cmdecho" 0) (setq s1 (getdist "\nEnter 1st Leg Size: ")) (if s1 (progn (initget 1) (setq s2 (getstring "\nEnter 2nd Leg Size or = for Equal Legs < = > : ")) (if (or (= s2 "") (= s2 "=")) (setq s2 s1) (setq s2 (atof s2))) (if (<= s2 0) (setq s2 s1)) (initget 7) (setq tk (getdist "\nEnter Thickness: ")) (if (or (> tk (* s1 0.57)) (> tk (* s2 0.57))) (progn (if (> s1 s2) (setq tk (* s2 0.57)) (setq tk (* s1 0.57)) ) (princ (strcat "\n Reducing Thickness to " (rtos tk 2 2))) ) ) (initget 7) (setq ip (getpoint "\nEnter Angle Insertion Point: ")) (setq ang (getangle ip "\nEnter Rotation Angle: ")) (if (= ang 'nil) (setq ang (/ pi 2))) (setq p2 (polar ip ang s1) p3 (polar p2 (- ang (/ pi 2)) (* tk 0.75)) p4 (polar (polar p3 (- ang (/ pi 2)) (* tk 0.25)) (- ang pi) (* tk 0.25)) p5 (polar p4 (- ang pi) (- s1 (* tk 1.75))) p6 (polar (polar p5 (- ang pi) (* tk 0.5)) (- ang (/ pi 2)) (* tk 0.5)) p7 (polar p6 (- ang (/ pi 2)) (- s2 (* tk 1.75))) p8 (polar (polar p7 (- ang (/ pi 2)) (* tk 0.25)) (- ang pi) (* tk 0.25)) p9 (polar p8 (- ang pi) (* tk 0.75)) olde (getvar "cmdecho") oldb (getvar "blipmode")) (command "undo" "g") (setvar "cmdecho" 0) (setvar "blipmode" 0) (command "pline" ip "w" "0" "0" p2 p3 "a" p4 "l" p5 "a" p6 "l" p7 "a" p8 "l" p9 "c" "setvar" "blipmode" oldb "undo" "e" "setvar" "cmdecho" olde) ) ) (setq *error* olderr) (princ) )