See the top rated post in this thread. Click here

Results 1 to 5 of 5

Thread: updating attribute text

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Member
    Join Date
    2001-03
    Posts
    19
    Login to Give a bone
    0

    Unhappy updating attribute text

    hi
    i have multiple wall tags. for example a tag for type 10 need to be updated to 17. the same block with attributes is used for all the other wall tags - such as wall type 16. is there a way to update 10 to 17 without changing all the other numbers in autocad 2002"?
    "battman" command does not work - there is some thing wrong with my installation.
    thanks

  2. #2
    100 Club
    Join Date
    2005-01
    Posts
    185
    Login to Give a bone
    1

    Default Re: updating attribute text

    Use the find command, set the options to attribute value and "whole words only" should be checked. then type 10 in the what to find box and 17 in the replace with box, then click replace all (if you only want to apply this to a portion of the drawing there is a button that will let use pick a window/crossing box)

    I just saw you are using 2002, I believe this command was still there then, but not sure as we are using 2006.

  3. #3
    I could stop if I wanted to tyshofner's Avatar
    Join Date
    2004-03
    Location
    Dallas, Tx
    Posts
    229
    Login to Give a bone
    0

    Default Re: updating attribute text

    Or, you can use this its quick and dirty with no error checking but it works! Cut and paste this into notepad save as ".lsp", and load it up.
    Code:
    ;This routine will replace the string value of attributes in the specified block
    ;it will only replace values that equal what you specify, no error checking
    (defun C:RAS ( / src_blk blk_name old_str new_str ss indx blk att att_alst)
      (setq src_blk (entsel "\nSelect the block which contains the attribute: "))
      (setq blk_name (cdr (assoc 2 (entget (car src_blk)))))
      (initget 1)
      (setq old_str (getstring T "\nEnter attribute string to replace: "))
      (initget 1)
      (setq new_str (getstring T "\nEnter new attribute string: "))
      (setq ss (ssget "X" (list '(-4 . "<AND") '(0 . "INSERT") (cons 2 blk_name) '(-4 . "AND>"))))
      (setq indx 0)
      (while (<= indx (- (sslength ss) 1))
    	(setq blk (ssname ss indx))
    	(setq att (entnext blk))
    	(while (and (/= att nil) (/= (cdr (assoc 0 (entget att))) "SEQEND"))
    	  (setq att_alst (entget att))
    	  (if (= (cdr (assoc 1 att_alst)) old_str)
    		(progn
    		   (setq att_alst (subst (cons 1 new_str) (assoc 1 att_alst) att_alst))
    		   (entmod att_alst)
    		   (entupd att)
    		)
    	  )
    	  (setq att (entnext att))
    	)
    	(setq indx (1+ indx))
      )
      (princ)
    )
    Ty

  4. #4
    Member
    Join Date
    2001-03
    Posts
    19
    Login to Give a bone
    0

    Default Re: updating attribute text

    thanks. that was great. i knew the text had a replace funtion but i didn't know about the find - replace attributes. thanks. tom

  5. #5
    The Silent Type Mike.Perry's Avatar
    Join Date
    2000-11
    Posts
    13,656
    Login to Give a bone
    0

    Default Re: updating attribute text

    Hi

    or....

    _.-AttEdit

    but, having just re-read your question I note you mention the BattMan command, therefore are you referring to an Attribute "Tag" or "Value"?

    BattMan would make sense for "Tag"

    EAttEdit / AttEdit / -AttEdit would make sense for "Value"

    Have a good one, Mike

Similar Threads

  1. 2015: Field in an Attribute not updating
    By derek.96018 in forum AutoCAD Customization
    Replies: 5
    Last Post: 2015-09-09, 05:06 PM
  2. Attribute text enhancement - linked attribute text
    By Wish List System in forum AutoCAD Wish List
    Replies: 1
    Last Post: 2014-10-22, 06:33 PM
  3. Field Attribute Not Updating on .NET Insert?
    By mcoffman in forum Dot Net API
    Replies: 1
    Last Post: 2011-06-17, 08:43 PM
  4. Updating Attribute text associated with multi-leaders
    By .chad in forum AutoCAD General
    Replies: 7
    Last Post: 2007-11-08, 09:26 PM
  5. Replies: 5
    Last Post: 2006-08-11, 01:32 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •