(defun c:test (/ os po w h1 h2 wpo h1lpo ang rad ang1 h1rpo l lpo rpo) (setvar "cmdecho" 0) (setq os (getvar "osmode")) (setvar "osmode" 0) (setq po (getpoint "\n选取一点:")) (setq w (getdist po "\nW值:")) (setq h1 (getdist po "\nH1值:")) (setq h2 (getdist po "\nH2值:"))
(setq wpo (polar po 0 w)) (setq h1lpo (polar po (* pi 1.5) h1)) (setq ang (getangle "\nAng角度:")) (setq rad (getdist "\nRad半径:")) (setq ang1 (- (* pi 1.5) ang)) (setq h1rpo (polar wpo (* pi 1.5) h1)) (setq l (/ (- h2 h1) (cos ang))) (setq lpo (polar h1lpo ang1 l)) (setq rpo (polar lpo 0 h1)) (command "pline" h1lpo lpo rpo h1rpo "") (setq en1 (entlast)) (command "line" h1rpo wpo po h1lpo "") (setvar "filletrad" rad) (command "FILLET" "p" en1) (setvar "osmode" os) (prin1) )