Lisp or VBA file to update multiple drawing titleblocks

Lisp or VBA file to update multiple drawing titleblocks

logan_ownbey5UKQZ
Contributor Contributor
200 Views
1 Reply
Message 1 of 2

Lisp or VBA file to update multiple drawing titleblocks

logan_ownbey5UKQZ
Contributor
Contributor

I am looking to create an LISP or VBA file that will update all drawing title block attributes in a folder. It needs to get all the attributes in the title block and all the user to select which attributes to update. It then needs to apply those updates to each drawing in the folder and save those drawings.

0 Likes
201 Views
1 Reply
Reply (1)
Message 2 of 2

Sea-Haven
Mentor
Mentor

A couple of answers and a question.

 

"to each drawing in the folder" Are the title blocks in Model or in layouts within a dwg ?

 

This function gets a list of dwgs.

(setq dwgs (vl-directory-files "d:/drawings" "*.dwg"))

You can either use a script or OBDX to do what you want and change an attribute value.

 

Re select attribute simplest way is to have at least one dwg open and pick the attribute this will return Tagname and block name. You enter new value and current dwg is updated, others are also updated. 

(setq ent (entget (car (nentsel "\nPick a attribute "))))
(setq tagname (cdr (assoc 2 ent)))
(setq tagstr (cdr (assoc 1 ent)))
(setq bname (cdr (assoc 2 (entget (cdr (assoc 330 ent)))))) ; thanks Lee-mac

 

 

 

0 Likes