;; | ----------------------------------------------------------------------------- ;; | TX_TextBox ;; | ----------------------------------------------------------------------------- ;; | Function : Creates a box around a text using the textbox function and ;; | returns the four points of the box ;; | Author : Rakesh Rao, Bangalore - India ;; | ;; | Arguments: 'ename' - Text entity name ;; | Updated : March 29, 2005 ;; | e-mail : rakesh.rao@4d-technologies.com ;; | Web : www.4d-technologies.com ;; | ----------------------------------------------------------------------------- (defun TX_TextBox ( ename / entl txt tb 1Char X Y DFactor AFactor Pt vlist Rot ) (setq entl (entget ename) Pt (LI_item 10 entl) Rot (LI_item 50 entl) txt (LI_item 1 entl) entl (subst (cons 1 "A") (assoc 1 entl) entl) tb (textbox entl) 1Char (car (cadr tb)) entl (entget ename) tb (textbox entl) X (cadr tb) Y (cadr X) X (car X) ) (if (or (wcmatch txt "*g*") (wcmatch txt "*j*") (wcmatch txt "*p*") (wcmatch txt "*q*") (wcmatch txt "*y*") ) (setq DFactor 0.4) ; Descending Factor (setq DFactor 0.3) ; Descending Factor ) (if (or (wcmatch txt "*b*") (wcmatch txt "*d*") (wcmatch txt "*f*") (wcmatch txt "*h*") (wcmatch txt "*i*") (wcmatch txt "*j*") (wcmatch txt "*k*") (wcmatch txt "*l*") (wcmatch txt "*t*") ) (setq AFactor 0.4) ; Ascending Factor (setq AFactor 0.3) ; Ascending Factor ) (setq Pt (polar Pt (+ Rot pi) (* 0.5 1Char)) Pt (polar Pt (- Rot #pb2) (* Y DFactor)) vlist (list (setq Pt (list (car Pt) (cadr Pt) 0.0)) (setq Pt (polar Pt Rot (+ X 1Char))) (setq Pt (polar Pt (+ Rot #pb2) (* Y (+ 1.0 DFactor AFactor)))) (setq Pt (polar Pt (+ Rot pi) (+ X 1Char))) ) ) vlist )