(defun C:trim-all-text ( / ssnab x list-txt)
  (load_global_variable)
  (setq ssnab (ssget "_I"))
  (if ssnab
    (progn
      (vla-StartUndoMark active_document)
      (setq list-txt (convert_ss_to_list ssnab))
      (foreach x list-txt
	(trim-current-text x)
	)
      (vla-EndUndoMark active_document)
      )
    )
  (princ)
  )

(defun trim-current-text (txt / angl dxf h l obj-polyline start-point t1 t2 t3 t4)
      (setq dxf (entget txt))
      (setq h(calculation_text_height_be_dxf_code dxf))
      (setq l(calculation_text_long_be_dxf_code dxf))
      (setq angl (cdr(assoc 50 dxf)))
      (setq start-point (cdr(assoc 10 dxf)))
      (setq t1 (polar (polar start-point (+ angl pi) 0.1)(+ angl (/ pi 2)) -0.1))
      (setq t2 (polar t1 angl (+ h 0.2)))
      (setq t3 (polar t2 (+ angl (/ pi 2)) (+ l 0.2)))
      (setq t4 (polar t1 (+ angl (/ pi 2)) (+ l 0.2)))
      (draw-lwpolyline-vla-by-list-property
	(list(cons "spece" (if (eq (getvar "CTAB")"Model")model_spece paper_spece))
	     (cons "Coordinates" (list t1 t2 t3 t4))
	     (cons "Closed" -1)
	     ))
      (setq obj-polyline (entlast))
      (etrim obj-polyline start-point)
      (entdel obj-polyline)
  )