TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: Biscuits on January 20, 2023, 03:09:54 PM
-
How would I go about changing the second line of code to avoid hitting enter?
I want to select the attribute definition automatically.
(defun C:MNO (/ str ss)
(setq str (getstring "\nYour [MAPNO] string search: ")) ;
(if (setq ss (ssget "_X" (list (cons 1 str) (cons 410 (getvar 'ctab)))))
(sssetfirst nil ss)
)
(command "justifytext" "previous" "" "mc")
)
Thanks
-
A slight change
(defun C:MNO (/ str ss)
(setq str (getstring "\nYour [MAPNO] string search: ")) ;
(if (setq ss (ssget "_X" (list (cons 0 "TEXT") (cons 1 str) (cons 410 (getvar 'ctab)))))
(repeat (setq x (sslength ss))
(setq ent (entget (ssname ss (setq x (1- x))) ))
(entmod (subst (cons 73 2) (assoc 73 ent) ent))
)
)
)
(c:mno)
-
Are you attempting to select an attribute reference, attribute definition, or text entity?
-
It is an attribute definition