(defun dtr(a)
  (* a (/ pi 180.0))
)
(defun C:Wlw()
 (setq c (getpoint "\n 输入螺纹中心点:"))
 (setq m0 (getreal "\n 输入螺纹规格:")) 
 (setq s (getreal "\n 输入绘图比例:"))
 (setq zx(getstring "\n 是否要中心线(Yes/<No>):"))
 (setq os(getvar "osmode"))
 (command "osmode" 0)
  (setq m (* m0 s))
  (setq r (/ m 2))
  (setq D1 (* m 0.85))
  (SETQ R1 (/ D1 2))
  (setq P1 (polar c (dtr 110) R1))
  (setq P2 (polar c (dtr 10) R1))
  (command  "circle" c R)
  (command "arc" p1 "ce" c p2)
  (cond ((or (= zx "y") (= zx "Y"))
        (setq zx1 (polar c 0 (+ r 2.5)))
        (setq zx2 (polar c pi (+ r 2.5)))
        (setq zx3 (polar c (/ pi 2) (+ r 2.5)))
        (setq zx4 (polar c (* pi 1.5) (+ r 2.5)))
        (command "line" zx3 zx4 "")
        (command "line" zx1 zx2 ""))
  )
  (command "osmode" os)
  (princ)
)
