AutoCAD Map 3D Developer
Welcome to Autodesk’s AutoCAD Map 3D Developer Forums. Share your knowledge, ask questions, and explore popular AutoCAD Map 3D Developer topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Mtext attribute update value autolisp

1 REPLY 1
SOLVED
Reply
Message 1 of 2
Anonymous
480 Views, 1 Reply

Mtext attribute update value autolisp

All-

 

I'm attempting to update an attribute mtext, with no avail from the following code:

 

(defun update_information ()
(setq x 0 str "")
(repeat (length lis)
(setq val (nth x lis))
(setq str (strcat val str))
(setq x (+ x 1))
)(dep 3 call)(setq fna1 (cons 1 ttc))(setq b (subst (cons 1 str) fna1 (entget d)))
(entmod b)

(princ)
)

 

(defun dep (hdep ent)
(setq x 1)
(setq b (entget ent))
(setq c (cdr (assoc -1 b)))
(repeat hdep
(setq d (entnext c))
(setq c d)
(setq ttc (cdr (assoc 1 (entget d))))
(setq x (+ x 1))
(princ)
))

 

The variable "lis" is a list of strings that I'm concatenating to update the mtext attribute and "call" is the variable containing the entity to be updated. I've attached the block as well. Any help would be greatly appreciated.

 

Thanks,

Michael Luckett

1 REPLY 1
Message 2 of 2
Anonymous
in reply to: Anonymous

Thanks to a post by Lee Mac at the below link, I was able to get around this issue.

 

(setq e (entget (entnext (entnext (entnext call)))))
(entmod (subst (cons 1 str) (assoc 1 (reverse e)) e))

 

https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/edit-mtext-attribute-value-using-lis...

 

Thanks,

Michael Luckett

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Technology Administrators


AutoCAD Beta