p7q Posted 2 hours ago Posted 2 hours ago Hi everyone, I’m trying to get the text from an Attribute Definition (ATTDEF) inside a dynamic block using AutoLISP, and then change that text. Unfortunately, I haven’t been able to make it work. Here is what I tried: (defun getblockentities (blk / ent enx rtn) (if (setq ent (tblobjname "block" blk)) (while (setq ent (entnext ent)) (setq enx (entget ent)) (if (= "INSERT" (cdr (assoc 0 enx))) (getblockentities (cdr (assoc 2 enx))) (progn (setq text (vlax-ename->vla-object ent)) (if (car text) (setq tlist (append tlist (list text))) ) ) ) ) ) ) And then I tried to collect attributes like this: (setq attlist (vlax-invoke textObj 'GetAttributes)) (foreach att attlist (if (not (eq (vla-get-tagstring att) nil)) (progn (setq text (vla-get-tagstring att)) (setq tlist (append tlist (list text))) ) ) ) But with this approach I couldn’t retrieve the attribute text. Is there another method to get (and later modify) the text string of an attribute inside a dynamic block? Thanks in advance for any guidance. 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.