Author Topic: Editing the same attribute in multiple blocks at one time???  (Read 22297 times)

0 Members and 1 Guest are viewing this topic.

CottageCGirl

  • Guest
Editing the same attribute in multiple blocks at one time???
« on: March 18, 2005, 02:06:07 PM »
I use furniture blocks containing: fabric, finish & options attributes; they are all differnt with different block names, EXCEPT they all have the same  room # attribute / in an old ACAD version apparently, my department had a way of selecting all the furniture in one room and changing all the room #'s at once (to match that room#) - I have tried Find/Replace & GATTE with no luck

Any thoughts?
because we now have to edit each block one-at-a-time  
(hundreds of them):(

VerticalMojo

  • Guest

VerticalMojo

  • Guest
Editing the same attribute in multiple blocks at one time???
« Reply #2 on: March 18, 2005, 02:27:20 PM »
just re-read your post.... that might not be what your looking for....

CADaver

  • Guest
Re: Editing the same attribute in multiple blocks at one tim
« Reply #3 on: March 18, 2005, 02:47:30 PM »
Explore -attedit (note the dash)

    Command: -ATTEDIT

    Edit attributes one at a time? [Yes/No] <Y>:
N

Performing global editing of attribute values.
Edit only attributes visible on screen? [Yes/No] <Y>: Y
Enter block name specification <*>: <ENTER A BLOCK NAME OR WILDCARDS>

Enter attribute tag specification <*>: <ENTER A TAG NAME OR WILDCARDS>

Enter attribute value specification <*>: <ENTER A BLOCK VALUE OR WILDCARDS>

Select Attributes: <Select Objects using any selection method>

2 attributes selected.
Enter string to change: <Enter Current string you wish to change>

Enter new string: <Enter what you want it to say>
[/list:u]

CottageCGirl

  • Guest
I'm not sure....
« Reply #4 on: March 21, 2005, 08:49:32 AM »
I may just be daft, but I don't think this will work in my situation.  My drawings will have anywhere from 700-1000 blocks which fall in up to 60 rooms.  I need to select (for example) 30 pieces to change to room #34, by using -ATTEDIT (great command by the way) it seems that I have to know which 30 out of the 700 are in that room- and then find them in the list.    The old way-noone seems to know how--we could use the mouse to select all the blocks in that room and change all the room # attributes--- The FIND/REPLACE  commands dont work because they "FIND" the seqence of numbers in ALL of the attributes (not just room#) and "REPLACE" messing up all the blocks (found out that one the hard way)
HELP...... :? [/url]

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Editing the same attribute in multiple blocks at one time???
« Reply #5 on: March 21, 2005, 09:54:25 AM »
Here is a quickie, I modified a subroutine written by Jeff Mishler.

Code: [Select]
;;  Room Number Update by CAB 03/21/2005
;;  Update selected blocks with attribute "ROOM#"
;;  with user entered room number
;;  NOTE: Very little error checking
;;
;;   Modified a subroutine by Jeff Mishler 1/11/05
;;
(defun c:rm#update (/ rm# attname ss count blk atts2 att2 att1 bc)
  (vl-load-com)

  (setq rm# (getstring t "\nEnter new room number: ")
        attname "ROOM#"  ; uppercase only
        bc 0) ; block counter

  (prompt "\n***  Select blocks to change room number.  ***")
  ;;  get only blocks with attributes
  (if (and rm#
           (not (eq rm# ""))
           (setq ss (ssget (list '(0 . "INSERT") '(66 . 1))))
      )
    (progn
      (setq count -1)
      (while (< (setq count (1+ count)) (sslength ss))
        (setq blk   (vlax-ename->vla-object (ssname ss count))
              atts2 (vlax-invoke blk "getattributes")
        )
        (foreach att2 atts2
          (if (= attname (vla-get-tagstring att2))
            (progn
              (vla-put-textstring att2 rm#)
              (vla-update att2)
              (vla-update blk)
              (setq bc (1+ bc))
            )
          )
        )
      )
      (prompt (strcat "\n-=< " (itoa bc) " blocked updated  >=-"))
    ) ; progn
    (prompt "\n---  No blocks Updated  ---")
  ) ; endif
  (princ)
) ; defun
(prompt "\nRoom Number Update Loaded, Enter Rm#Update to run.")
(princ)
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

CADaver

  • Guest
Re: I'm not sure....
« Reply #6 on: March 21, 2005, 11:05:51 AM »
Quote from: CottageCGirl
-ATTEDIT (great command by the way) it seems that I have to know which 30 out of the 700 are in that room- and then find them in the list.    The old way-noone seems to know how--we could use the mouse to select all the blocks in that room and change all the room # attributes---


-Attedit (note the dash) allows you select attributes without knowing ANY names.  If you use an asterisk * in response to block name, tag name and value, a window or crossing will get ALL attributes residing in that window.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Editing the same attribute in multiple blocks at one time???
« Reply #7 on: March 21, 2005, 11:19:57 AM »
Very handy command when you know all the options, :)
Thanks CADaver
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

CADaver

  • Guest
Editing the same attribute in multiple blocks at one time???
« Reply #8 on: March 21, 2005, 12:18:48 PM »
Quote from: CAB
Very handy command when you know all the options, :)
Thanks CADaver
I go back to before dialog boxes, when that was the ONLY way to edit attributes.  Using wildcards for block names, tag names and/or values can further define the selection set.

Quote
Command: -ATTEDIT

Edit attributes one at a time? [Yes/No] <Y>: N

Performing global editing of attribute values.
Edit only attributes visible on screen? [Yes/No] <Y>: Y
Answering YES to the second question above means the user will be prompted to "Select Objects".  Answering NO, will perform a global edit of ALL attributes in the current tab, that match the selection criteria will be editted.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Editing the same attribute in multiple blocks at one time???
« Reply #9 on: March 21, 2005, 12:26:36 PM »
I may be that old but I don't go that far back. :)  :)  :)
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

CADaver

  • Guest
Editing the same attribute in multiple blocks at one time???
« Reply #10 on: March 21, 2005, 12:50:00 PM »
Quote from: CAB
I may be that old but I don't go that far back. :)  :)  :)
Oh boy, another "Old Farts" thread
I think DDATTE was added for R9, back in 1987, prior to that ATTEDIT was all you had.  

But then I remember having to re-type an entire line of text to fix one letter.  I helped a guy named Frank Emerick write a lisp function for V2.5 called CHGTEXT.LSP "A Rudimentary Text Editor" to find and replace strings inside text elements. Course, my help was limited to not much more than "That didn't work, Frank" and "Now it does, cool" :?

CottageCGirl

  • Guest
Finally got back to this problem
« Reply #11 on: April 04, 2005, 11:42:55 AM »
CADaver: thanks that command works great for a clean drawing-so it's a great temporary hold until I get the lsp down. The prob comes in when we have changed all of the room#'s already, then have to rework the whole plan then all of the#'s are different (we then have to re edit all of the room # attributes all over again)--"edit string to change" is no longer a constant and I end up editing them one at a time ---UNLESS I AM MISSING SOMETHING---????
Is there a way to change all of the ROOM attributes back to "00" regardless of their current value?

CAB:  I am working on the lsp and have a ?, in the 4th line attname "ROOM#";   does that refer to the attribute Tag or the attribute Prompt?  
I get to select items then it stops
My Tag = "ROOM"  and Prompt = "Room#"

daron

  • Guest
Editing the same attribute in multiple blocks at one time???
« Reply #12 on: April 04, 2005, 01:17:53 PM »
You take the att TAGSTRING of each block  as a reference and change the TEXTSTRING for each attribute. Search is a beautiful tool if you know what your are looking for.

Chuck Gabriel

  • Guest
Re: I'm not sure....
« Reply #13 on: April 04, 2005, 01:33:11 PM »
Quote from: CottageCGirl
... The FIND/REPLACE  commands dont work because they "FIND" the seqence of numbers in ALL of the attributes (not just room#) and "REPLACE" messing up all the blocks (found out that one the hard way)
HELP...... :? [/url]


Actually, although the default behavior for find/replace is to work on the entire drawing, you can select entities and have it work only on those entities.  Just click the button in the dialog to the right of where it says "Entire drawing."

CottageCGirl

  • Guest
YIPPPPEEEEE!!!!
« Reply #14 on: April 05, 2005, 09:55:18 AM »
Thanks Everyone!   ESPECIALLY CAB!
I finally have a custom button for my problem. (makes me a hero!)
This will cut off .5-1 hour for every project for 9 designers!!!!
AND I am understanding more and more each day! :D  :!: