Try this.
(vl-load-com) (defun c:Tcountrad ( / s c m n i l ) (or *trc-b* (setq *trc-b* (/ pi 2))) (or *trc-d* (setq *trc-d* "CW")) (or *trc-p* (setq *trc-p* "Prefix")) (and (setq s (ssget "_:L" '((0 . "*TEXT")))) (princ (strcat "\nCurrent setting: Start at: " (angtos *trc-b*) " Direction: " *trc-d*)) (setq c (cond ((getpoint "\nCenter point <setting...>: ")) ((setq c (getpoint "\nCenter point: ")) (setq *trc-b* (cond ((getangle c (strcat "\nInitial angle <" (angtos *trc-b*) ">: "))) (*trc-b*))) (initget "CW CCW") (setq *trc-d* (cond ((getkword (strcat "\nDirection [CW clockwise/CCW counterclockwise] <" *trc-d* ">: "))) (*trc-d*))) c))) (setq m (getstring "\nSpecify starting number and increment (Start,increment) <1,1>: ")) (setq m (if (= m "") "1,1" m)) (setq i (if (vl-string-search "," m) (atoi (substr m (+ 2 (vl-string-search "," m)))) 1)) (setq n (- (atoi m) i)) (not (initget "Prefix Overwrite Suffix")) (setq *trc-p* (cond ((getkword (strcat "\nPlacement of numbers in text [Overwrite/Prefix/Suffix] <" *trc-p* ">: "))) (*trc-p*))) (setq l (vl-remove-if 'listp (mapcar 'cadr (ssnamex s)))) (setq l (mapcar '(lambda (e) (list e (cdr (assoc (if (and (= "TEXT" (cdr (assoc 0 (entget e)))) (/= (getpropertyvalue e "Justify") 0)) 11 10) (entget e))))) l)) (setq l (vl-sort l '(lambda (e1 e2) ((if (= *trc-d* "CW") > <) (if ((if (= *trc-d* "CW") >= >) *trc-b* (setq a (angle c (trans (cadr e1) 0 1)))) (+ a pi pi) a) (if ((if (= *trc-d* "CW") >= >) *trc-b* (setq a (angle c (trans (cadr e2) 0 1)))) (+ a pi pi) a))))) (mapcar '(lambda (e / o) (setpropertyvalue e (if (and (setq o (getpropertyvalue e (if (= "TEXT" (cdr (assoc 0 (entget e)))) "TextString" "Text"))) (= "TEXT" (cdr (assoc 0 (entget e))))) "TextString" "Contents") (strcat (if (= *trc-p* "Suffix") o "") (itoa (setq n (+ n i))) (if (= *trc-p* "Prefix") o "")))) (mapcar 'car l)) ) (princ) )
Thanks a lot BeekeeCZ, Your help means lot to me.🙏
its working perfect.
If possible can you alter for starting number choice option.
NOT going to repeat myself. It's not rocket science.
Anyway, use updated code - changed the workflow a little bit.
Good luck.
Do they always fill a full circle, at equal radial spacing? If so, it should be possible for a routine to calculate the center, so the User doesn't need to specify it.
Thanks for the response.
ok i will try.
[Off-topic, but.... Your latest Message (9) shows as being in Reply to yourself. That probably means you wrote it in the "Reply to the topic..." slot below, because anything entered there always shows as being in Reply to the originator of Message 1. To make it clearer to whom you are Replying, use the REPLY button near the bottom right of the particular Message you're Replying to.]
Yes always at equal intervals on the circle but starting location may change