Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations IDS on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Attribute text editing

Status
Not open for further replies.

bot1357

Electrical
Mar 31, 2003
52
Hi,

I have around 300 hundred drawings with attributed text on them. The attributed text contains drawing title, drawing number, revision status etc. I was wondering if it was possible to write some sort of script to automatically up-rev the drawing and then up-date the attributed text?

Cheers
Danjo
 
Replies continue below

Recommended for you

Are you looking to do it with script or vba. It can be done either way?

"Whether you think that you can, or that you can't, you are usually right "
.. Henry Ford
 
Script file would be sorted...

Cheers
Danjo
 
Hi Bot1357...

Do you need that the text is modernized automatically?...

I made a routine so that it is modernized the date and the name of the drawing automatically every time that opens up, but I don't know if it is that what you want...

It also exists a called command RTEXT...

Un saludo de SpeedCAD... :)
CHILE
 
I am not sure what knowledge you have already (of programming), but you can call this LISP within the script to change your attributes.

(defun C:UPDATE_BLK_ATTS ()
(vl-load-com)
(setq BLKSS (ssget "X" '((2 . "YOUR_BLK_NAME_HERE")))) ;!!!!!!!!!!!!!!!!!!!!!
(setq BALENT (ssname BLKSS 0))
(setq ATTLIST
(vlax-safearray->list
(variant-value
(vla-getattributes (vlax-ename->vla-object BALENT))
)
)
)
(setq TAGNAME1 "YOUR_TAG_NAME_HERE" ;!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
NEWATT1 "YOUR_NEW_ATT_INFO_HERE" ;!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
TAGNAME2 "YOUR_TAG_NAME2_HERE" ;!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
NEWATT2 "YOUR_NEW_ATT_INFO2_HERE" ;!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
) ;setq
(foreach ITEM ATTLIST
(cond
((= (vla-get-tagstring ITEM) TAGNAME1)(vla-put-textstring ITEM NEWATT1))
((= (vla-get-tagstring ITEM) TAGNAME2)(vla-put-textstring ITEM NEWATT2))
) ;cond
) ;foreach
(princ)
) ;defun


"Whether you think that you can, or that you can't, you are usually right "
.. Henry Ford
 
Superb lads

Thanks very much for your help

Cheers
Danjo
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor