Can anyone help me on numbering like tcount for Radial slection like clock numbering

Can anyone help me on numbering like tcount for Radial slection like clock numbering

Mistersakthivel
Participant Participant
1,140 Views
10 Replies
Message 1 of 11

Can anyone help me on numbering like tcount for Radial slection like clock numbering

Mistersakthivel
Participant
Participant

Mistersakthivel_1-1674193730919.png

 

 

0 Likes
Accepted solutions (1)
1,141 Views
10 Replies
Replies (10)
Message 2 of 11

ВeekeeCZ
Consultant
Consultant
Accepted solution

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)
  )

 

0 Likes
Message 3 of 11

Mistersakthivel
Participant
Participant

Thanks a lot BeekeeCZ, Your help means lot to me.🙏

its working perfect.

If possible can you alter for starting number choice option.

0 Likes
Message 4 of 11

ВeekeeCZ
Consultant
Consultant

It's already possible.

0 Likes
Message 5 of 11

Mistersakthivel
Participant
Participant

Thank you for your reply @ВeekeeCZ ,  the starting number is always at the top position.

sometimes i have to change it.

 

 

 

0 Likes
Message 6 of 11

Mistersakthivel
Participant
Participant

Mistersakthivel_0-1674216131850.png

0 Likes
Message 7 of 11

ВeekeeCZ
Consultant
Consultant

NOT going to repeat myself. It's not rocket science.

Anyway, use updated code - changed the workflow a little bit.

Good luck.

Message 8 of 11

Kent1Cooper
Consultant
Consultant

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.

Kent Cooper, AIA
0 Likes
Message 9 of 11

Mistersakthivel
Participant
Participant

Thanks for the response. 

ok i will try. 

0 Likes
Message 10 of 11

Kent1Cooper
Consultant
Consultant

[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.]

Kent Cooper, AIA
Message 11 of 11

Mistersakthivel
Participant
Participant

Yes always at equal intervals on the circle but starting location may change

0 Likes