本帖最后由 chpmould 于 2012-4-4 16:06 编辑  
 
刚好有空,修改了下,你试试... - (defun c:test ( / a ac fou n one pt1 qend str tow trhee)
 
 -   (princ "\nPlease select a rectangle:")
 
 -   (setq a (entsel))
 
 -   (setq ac (entget (car a))
 
 -         n 0
 
 -   )
 
 -   (repeat (length ac)
 
 -     (setq qend (nth n ac))
 
 -     (if (= (car qend) 10)
 
 -       (setq one (cdr qend))
 
 -       (setq n (1+ n))
 
 -     )
 
 -   )
 
 -   (setq tow (cdr (nth (+ n 4) ac))
 
 -         trhee (cdr (nth (+ n 8) ac))
 
 -         fou (cdr (nth (+ n 12) ac))
 
 -         pt1 (getpoint "\nPlease select a point:")
 
 -         str (strcat (rtos (distance one tow) 2 2) "X" (rtos
 
 -                                                             (distance one
 
 -                                                                       fou
 
 -                                                             ) 2 2
 
 -                                                       )
 
 -             )
 
 -   )
 
 -   (entmake (list '(0 . "TEXT") (cons 1 str) (cons 10 pt1) (cons 40
 
 -                                                                 (*
 
 -                                                                    (distance one tow)
 
 -                                                                    0.1
 
 -                                                                 )
 
 -                                                           )
 
 -            )
 
 -   )
 
 -   (princ)
 
 - )
 
 
  |