I am trying to create a simple lisp that will find a mtext with the string "design variance" and put that mtext on an existing layer called Project. I always have trouble with scripts that have to find or get something.
Thanks
Solved! Go to Solution.
Solved by hmsilva. Go to Solution.
Quick and dirty, no error checking, and may not work if the mtext string is > 255 characters
(vl-cmdf "._change" (ssget "_X" '((0 . "MTEXT")(1 . "*DESIGN VARIANCE*"))) "" "_P" "_LA" "Project" "" "")
@Anonymous wrote:
I am trying to create a simple lisp that will find a mtext with the string "design variance" and put that mtext on an existing layer called Project. I always have trouble with scripts that have to find or get something.
Another, also quick and dirty, no error checking...
(defun c:test (/ ent i ss) (if (setq ss (ssget "X" '((0 . "MTEXT") (1 . "*design variance*")))) (repeat (setq i (sslength ss)) (setq ent (entget (ssname ss (setq i (1- i))))) (entmod (subst (cons 8 "Project") (assoc 8 ent) ent)) ) ) (princ) )
If the layer Project does not exist, will be created.
HTH
Henrique
Can't find what you're looking for? Ask the community or share your knowledge.