(defun C:pd()
 (setq o(getpoint "\n 输入插入点:"))
 (setq d0(getreal "\n 输入平垫规格:"))
 (SETQ SC(GETREAL "\n 输入比例系数:"))
 (setq ang1(getangle o "\n 输入旋转角度:"))
 (setq ang(- (/ (* ang1 180) pi) 90))
 (setq os(getvar "osmode"))
 (command "osmode" 0)
 (cond ((= d0 5) (setq D20 10.0) (setq H0 1.3))
       ((= D0 6) (setq D20 12.0) (setq H0 1.6))
       ((= D0 8) (setq D20 16.0) (setq H0 2.1))
       ((= D0 10) (setq D20 20.0) (setq H0 2.6))
       ((= D0 12) (setq D20 24.0) (setq H0 3.1))
       ((= D0 16) (setq D20 30.0) (setq H0 4.1))
       ((= D0 20) (setq D20 37.0) (setq H0 5.0))
       ((= D0 24) (setq D20 44.0) (setq H0 6.0))
       ((= D0 30) (setq D20 56.0) (setq H0 7.5))
  )
  (SETQ D(* D20 sc))
  (setq H(* H0 sc))
  (SETQ P1 (LIST (- 0 (/ d 2)) 0))
  (setq p2 (list (/ d 2) 0))
  (setq p3 (list (/ d 2) h))
  (setq p4 (list (- 0 (/ d 2)) h))
  (command "ucs" "o" o)
  (command "ucs" "z" ang)
  (command "pline" p1 "w" "0" "0" p2 p3 p4 "c") 
  (command "ucs" "z" (- 0 ang))
  (command "ucs" "w")
  (command "osmode" os)
  (COMMAND "REDRAWALL")
  (princ)
)

