minhphuong_humg Posted September 15, 2015 Share Posted September 15, 2015 Hi, everybody. I have a lisp collected automatically numbered. However, while the number of small numbers fits in the circle (with wipeout) but when bigger numbers, it does not automatically fit into that circle. Please help me to the circle automatically fits numbered (with wipeout). Thank you very much! Please view file attach: DSTT.lsp 2case.dwg Quote Link to comment Share on other sites More sharing options...
satishrajdev Posted September 15, 2015 Share Posted September 15, 2015 Try to set Text Height or Width Factor as per text string length. Quote Link to comment Share on other sites More sharing options...
Tharwat Posted September 15, 2015 Share Posted September 15, 2015 Try this program that I have just wrote and added to my tool box (defun c:test (/ *error* _bx cm ss s i wp tx e d mid) ;;------------------------------------;; ;; Author : Tharwat 15.09.2015 ;; ;; Resize texts inside wipeouts ;; ;;------------------------------------;; (defun *error* (msg) (if cm (setvar 'cmdecho cm) ) (if (and msg (wcmatch (strcase msg) "*BREAK*,*CANCEL*,*EXIT*")) (princ (strcat "\n ** Error : " msg " **")) ) (princ) ) (defun _bx (o / l r a b c d) (vla-getboundingbox (vlax-ename->vla-object o) 'l 'r) (setq a (vlax-safearray->list l) b (vlax-safearray->list r) c (list (car b) (cadr a)) d (distance a c) ) (list a b c d) ) (if (setq ss (ssget '((0 . "WIPEOUT")))) (repeat (setq i (sslength ss)) (setq wp (_bx (ssname ss (setq i (1- i))))) (if (setq s (ssget "_C" (car wp) (cadr wp) '((0 . "TEXT")) ) ) (progn (setq e (ssname s 0) tx (_bx e) d (last wp) cm (getvar 'cmdecho) ) (setvar 'cmdecho 0) (command "_.scale" e "" (setq mid (mapcar '(lambda (q p) (/ (+ q p) 2.)) (car wp) (cadr wp) ) ) "_r" "_none" (car tx) "_none" (caddr tx) (- d (/ d 5.)) ) (setq tx (_bx e)) (command "_.move" e "" "_none" (mapcar '(lambda (q p) (/ (+ q p) 2.)) (car tx) (cadr tx)) "_none" mid ) ) ) ) ) (*error nil) (princ) )(vl-load-com) Quote Link to comment Share on other sites More sharing options...
77077 Posted September 15, 2015 Share Posted September 15, 2015 Try this program that I have just wrote and added to my tool box (defun c:test (/ *error* _bx cm ss s i wp tx e d mid) ;;------------------------------------;; ;; Author : Tharwat 15.09.2015 ;; ;; Resize texts inside wipeouts ;; ;;------------------------------------;; (defun *error* (msg) (if cm (setvar 'cmdecho cm) ) (if (and msg (wcmatch (strcase msg) "*BREAK*,*CANCEL*,*EXIT*")) (princ (strcat "\n ** Error : " msg " **")) ) (princ) ) (defun _bx (o / l r a b c d) (vla-getboundingbox (vlax-ename->vla-object o) 'l 'r) (setq a (vlax-safearray->list l) b (vlax-safearray->list r) c (list (car b) (cadr a)) d (distance a c) ) (list a b c d) ) (if (setq ss (ssget '((0 . "WIPEOUT")))) (repeat (setq i (sslength ss)) (setq wp (_bx (ssname ss (setq i (1- i))))) (if (setq s (ssget "_C" (car wp) (cadr wp) '((0 . "TEXT")) ) ) (progn (setq e (ssname s 0) tx (_bx e) d (last wp) cm (getvar 'cmdecho) ) (setvar 'cmdecho 0) (command "_.scale" e "" (setq mid (mapcar '(lambda (q p) (/ (+ q p) 2.)) (car wp) (cadr wp) ) ) "_r" "_none" (car tx) "_none" (caddr tx) (- d (/ d 5.)) ) (setq tx (_bx e)) (command "_.move" e "" "_none" (mapcar '(lambda (q p) (/ (+ q p) 2.)) (car tx) (cadr tx)) "_none" mid ) ) ) ) ) (*error nil) (princ) )(vl-load-com) Good routine. you are most helpful. Quote Link to comment Share on other sites More sharing options...
Tharwat Posted September 15, 2015 Share Posted September 15, 2015 Good routine. you are most helpful. Haha .. thanks. Actually I needed this routine once or twice before but I was lazy in that time to write one , so today I pushed me self to write a complete one and I think I did it. Enjoy. Quote Link to comment Share on other sites More sharing options...
BIGAL Posted September 16, 2015 Share Posted September 16, 2015 The other way is to look at the number of characters and increase the circle diameter as you create. Quote Link to comment Share on other sites More sharing options...
minhphuong_humg Posted September 16, 2015 Author Share Posted September 16, 2015 Try this program that I have just wrote and added to my tool box (defun c:test (/ *error* _bx cm ss s i wp tx e d mid) ;;------------------------------------;; ;; Author : Tharwat 15.09.2015 ;; ;; Resize texts inside wipeouts ;; ;;------------------------------------;; (defun *error* (msg) (if cm (setvar 'cmdecho cm) ) (if (and msg (wcmatch (strcase msg) "*BREAK*,*CANCEL*,*EXIT*")) (princ (strcat "\n ** Error : " msg " **")) ) (princ) ) (defun _bx (o / l r a b c d) (vla-getboundingbox (vlax-ename->vla-object o) 'l 'r) (setq a (vlax-safearray->list l) b (vlax-safearray->list r) c (list (car b) (cadr a)) d (distance a c) ) (list a b c d) ) (if (setq ss (ssget '((0 . "WIPEOUT")))) (repeat (setq i (sslength ss)) (setq wp (_bx (ssname ss (setq i (1- i))))) (if (setq s (ssget "_C" (car wp) (cadr wp) '((0 . "TEXT")) ) ) (progn (setq e (ssname s 0) tx (_bx e) d (last wp) cm (getvar 'cmdecho) ) (setvar 'cmdecho 0) (command "_.scale" e "" (setq mid (mapcar '(lambda (q p) (/ (+ q p) 2.)) (car wp) (cadr wp) ) ) "_r" "_none" (car tx) "_none" (caddr tx) (- d (/ d 5.)) ) (setq tx (_bx e)) (command "_.move" e "" "_none" (mapcar '(lambda (q p) (/ (+ q p) 2.)) (car tx) (cadr tx)) "_none" mid ) ) ) ) ) (*error nil) (princ) )(vl-load-com) Thank Tharwat very much! Good luck for you. Quote Link to comment Share on other sites More sharing options...
minhphuong_humg Posted September 16, 2015 Author Share Posted September 16, 2015 The other way is to look at the number of characters and increase the circle diameter as you create. Thank BIGAL very much! Quote Link to comment Share on other sites More sharing options...
Tharwat Posted September 16, 2015 Share Posted September 16, 2015 Thank Tharwat very much! Good luck for you. You are welcome. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.