(defun c:miaotu	(/ *error* err-new err-old p1 p2 setucs ENDED ERR-NEW)
  (defun err-new (msg)

    (command "._redraw")
    (princ msg)
    (ended)
  )
;;;________________________________
  (defun ended (/ tmp)
    (setq *error* err-old)
    (if	setucs
      (command "_.ucs" "p")
    )
  )
  (setq err-old *error*)
  (setq *error* err-new)
  (princ "\nWRITEN BY WKAI , XDCAD.NET , 20040611")
  (setvar "ORTHOMODE" 0)
  (setvar "cmdecho" 1)
  
  (if (setq p1 (getpoint "\n指定第一点:"))
    (if	(setq p2 (getpoint p1 "\n指定下一点:"))      
      (progn
	(setq p1 (trans p1 1 0))
	(setq p2 (trans p2 1 0))
	(entmake (list (cons 0 "LINE") (cons 10 P1) (cons 11 P2)))
	(command "_.ucs" "ob" (entlast))
	(setq setucs t)
	(entdel (entlast))
	(setvar "ORTHOMODE" 1)
	(command "_.pline" (trans p1 0 1) (trans p2 0 1))
	(while (/= (getvar "cmdactive") 0)
	  (command pause)
	)
	(command)
      )
    )
  )
  (ended)
)