leonucadomi Posted June 30, 2022 Posted June 30, 2022 hello : I have an mtext group I want to make a selection (with ssget "x") of the texts color blue and 150 and change their height , color and layer the text height i need is 6 and layer name is DOLWIN6_EL_TEXT, new color bylayer. can anybody help me? thanks Quote
Emmanuel Delay Posted June 30, 2022 Posted June 30, 2022 Sure. Command SCTP (your title abbreviated. Feel free to change this) (defun c:sctp ( / ss i ent) ;; I want to make a selection (with ssget "x") of the texts color blue and 150 ;; (cons 62) is the color. 5 is blue; 150 is light blue ;; let's do sctp twice, once for blue, once for light blue (sctp 5) (sctp 150) ) (defun sctp ( color / ss i ent) (setq ss (ssget "_X" (list (cons 0 "TEXT,MTEXT") (cons 62 color)))) ;; change their height = (cons 40), color = (cons 62) and layer = (cons 8) ;; loop over all the selected Text/MText objects (setq i 0) (if ss (repeat (sslength ss) (setq ent (ssname ss i)) ;; modifying objects with entmod. ;; substitute groups with (subst new_group old_group entget_list) (entmod (subst (cons 62 256) ;; 256 sets the color to ByLayer (assoc 62 (entget ent)) ;; the current color (entget ent) )) (entmod (subst (cons 40 6.0) ;; text height (assoc 40 (entget ent)) (entget ent) )) (entmod (subst (cons 8 "DOLWIN6_EL_TEXT") ;; layer (assoc 8 (entget ent)) (entget ent) )) (setq i (+ i 1)) ) ) ) Quote
leonucadomi Posted June 30, 2022 Author Posted June 30, 2022 the function entsel can be used as a selection window? similar to ssget "_C" ? Quote
mhupp Posted June 30, 2022 Posted June 30, 2022 1 hour ago, leonucadomi said: the function entsel can be used as a selection window? No it single item selection only. Quote
BIGAL Posted July 1, 2022 Posted July 1, 2022 If you remove the "X" from the ssget it will be a more manual pick but a window select is supported. Quote
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.