(defun dtr(a)
  (* a (/ pi 180.0))
)
(defun C:Nlw()
 (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 P1 (polar c (dtr 100) r))
  (setq P2 (polar c (dtr 10) r))
  (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  "circle" c "d" D1)
  (command "arc" p1 "c" c p2)
  (command "osmode" os)
  (princ)
)
