(defun dg()
   (cond
      ((null Po) (*error* "Please input orginal Point !!!"))
      ((null Phd) (*error* "Please input vertical level !!!"))
      ((null Pvd) (*error* "Please input horizontal level !!!"))
      ((null Ts) (*error* "Please input text size !!!"))
      ((null Ac) (*error* "Please input Accurcy !!!"))
      (t (setvar "menuecho" 1)
         (setvar "cmdecho" 0)
         (setq a (list nil))
         (prompt "\nPlease select item:")
         (setq S1 (ssget))
         (setq N (sslength S1))
         (while (> N 0)
            (setq N (1- N))
            (setq E1 (entget (ssname S1 N)))
            (if (not (null (setq C1 (assoc '10 E1))))
                      (setq a (append a (list
                              (list (atof (rtos (cadr C1) 2 Ac))
                                    (atof (rtos (caddr C1) 2 Ac))
                              ))))
            )
            (if (not (null (setq C1 (assoc '11 E1))))
                      (setq a (append a (list
                              (list (atof (rtos (cadr C1) 2 Ac))
                                    (atof (rtos (caddr C1) 2 Ac))
                              ))))
            )
         )
         (setq aa (cdr a))
         (setq N (length aa))
         (setq bb (list nil))
         (while (> N 0)
            (setq N (1- N))
            (setq c (nth N aa))
            (setq bb (append bb (list (list (cadr c) (car c)))))
         )
         (setq bb (cdr bb))
         'DONE
      )
   )
)
