Can I insert attribute in all current opened drawing's layout?

Can I insert attribute in all current opened drawing's layout?

skchui6159
Advocate Advocate
4,811 Views
47 Replies
Message 1 of 48

Can I insert attribute in all current opened drawing's layout?

skchui6159
Advocate
Advocate

(defun reptag (tag newvalue ent / alist )
(if (and (= (type ent) (read "VLA-OBJECT")) newvalue)
(progn
(setq alist ( vlax-invoke ent 'GetAttributes))
(foreach a alist
(if (= (vla-get-tagstring a) tag)
(vlax-put-property a 'TextString newvalue)
);i
);fe
);p
(if (= 'ename (type ent)) (reptag tag newvalue (vlax-ename->vla-object ent)));i
);i
(princ));d

(defun c:OS ( / ent ss1)
;(setq ent (car (entsel)))
(foreach Layout (layoutlist)
(setq dateofinput "07/24")
(setq ss1 (ssget '(788 190 0)))
(setq ent (ssname ss1 0))
(reptag "ORIGINAL" "ORIGINAL" ent)
(reptag "SIGNED" "SIGNED" ent)
(reptag "GSTAUTHDATE" dateofinput ent)
(reptag "GSTFCHECKDATE" dateofinput ent)
(reptag "GST2CHECKDATE" dateofinput ent)
(reptag "GST1CHECKDATE" dateofinput ent)
(reptag "GSTDRAWDATE" dateofinput ent)
); foreach end
(princ))

 

The above lisp can run only single layout, but I want to apply all current opened drawing's? Anyone can help? Thx

0 Likes
4,812 Views
47 Replies
Replies (47)
Message 41 of 48

skchui6159
Advocate
Advocate

Change one Block only. Block Name is "TITLE BLOCK". Tag Name is "GSTDWGNO". Thank you.

0 Likes
Message 42 of 48

paullimapa
Mentor
Mentor
Accepted solution

Try attached BW7.lwp


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
Message 43 of 48

skchui6159
Advocate
Advocate

Thank you for very much!  CHEERS! It works great!

0 Likes
Message 44 of 48

paullimapa
Mentor
Mentor

You are welcome…cheers!!!


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes
Message 45 of 48

skchui6159
Advocate
Advocate

.

0 Likes
Message 46 of 48

skchui6159
Advocate
Advocate

@paullimapa A more question, how to change the "Test Style" and "Justification" to Center , height for Specific "tag" in a Block using Lisp, thank you🤣

0 Likes
Message 47 of 48

paullimapa
Mentor
Mentor

Since that’s a new topic, you should create a new post to get maximum feedback 


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes
Message 48 of 48

skchui6159
Advocate
Advocate

@paullimapa OK, thx

0 Likes