Author Topic: Attribute editor  (Read 4090 times)

0 Members and 1 Guest are viewing this topic.

AVCAD

  • Guest
Attribute editor
« on: June 25, 2004, 04:41:36 PM »
I am looking for a not so GLobal Attribute editor.

All I want it to do is:

1: I want to select a group of blocks that have attriubutes.
2: I want to change one attribute and have all of the selected attributes take that change.

I dont want to do a global...change this blocks attribute because I have some that dont need to be changed.

Right know I am using a Lisp file I created that I select a bunch of blocks with attributes and it allows me to edit them but I have to edit each one seperatly. Most of the time it is jsut a number change or something stupid that takes up some time. So if I could do one change and have the rest take the effect It would ROCK!!

THANKS!!

Columbia

  • Guest
Attribute editor
« Reply #1 on: June 28, 2004, 11:47:16 AM »
Be prewarned this was never bug checked!!!

Code: [Select]


(vl-load-com)

(defun c:test (/ ss tag val attributeList attrib i oBlock)
  (setq tag (getstring "\nWhich attribute (tag) do you want to edit?  "))
  (setq val (getstring "\nWhat is the new value?  "))
  (if (and tag (/= tag "") val (/= val ""))
  (while
    (progn
      (princ "\nSelect block objects...")
      (setq ss (ssget (list (cons 0 "INSERT"))))
    )
    (setq i 0)
    (repeat (sslength ss)
       (setq oBlock (vlax-ename->vla-object (ssname ss i)))
       (if (= (vla-get-HasAttributes oBlock) :vlax-true)
         (progn
            (setq attributeList
              (vlax-safearray->list
                (variant-value (vla-GetAttributes oBlock))
              )
            )
            (foreach attrib attributeList
               (if (= (vla-get-TagString attrib) tag)
                 (vla-put-TextString attrib val)
               )
            )
          )
        )
        (setq i (1+ i))
     )
  )
  (princ)
)

M-dub

  • Guest
Attribute editor
« Reply #2 on: June 28, 2004, 11:50:58 AM »
Haven't tried this but, couldn't you use find/replace and select the ones you wanted to change only?
Just an idea...

nivuahc

  • Guest
Attribute editor
« Reply #3 on: June 28, 2004, 11:57:46 AM »
What's wrong with this?

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

Enter block name specification <*>: *

Enter attribute tag specification <*>: *

Enter attribute value specification <*>: *
Select Attributes:

ELOQUINTET

  • Guest
Attribute editor
« Reply #4 on: June 28, 2004, 01:38:47 PM »
have you tried trevs editor in show your stuff section? it has a find and replace option and one by one so you can keep as is or change check it out

AVCAD

  • Guest
Attribute editor
« Reply #5 on: June 29, 2004, 10:31:57 AM »
Something is wrong with the code. I get a ; error: malformed list on input error.



Quote from: Columbia
Be prewarned this was never bug checked!!!

Code: [Select]


(vl-load-com)

(defun c:test (/ ss tag val attributeList attrib i oBlock)
  (setq tag (getstring "\nWhich attribute (tag) do you want to edit?  "))
  (setq val (getstring "\nWhat is the new value?  "))
  (if (and tag (/= tag "") val (/= val ""))
  (while
    (progn
      (princ "\nSelect block objects...")
      (setq ss (ssget (list (cons 0 "INSERT"))))
    )
    (setq i 0)
    (repeat (sslength ss)
       (setq oBlock (vlax-ename->vla-object (ssname ss i)))
       (if (= (vla-get-HasAttributes oBlock) :vlax-true)
         (progn
            (setq attributeList
              (vlax-safearray->list
                (variant-value (vla-GetAttributes oBlock))
              )
            )
            (foreach attrib attributeList
               (if (= (vla-get-TagString attrib) tag)
                 (vla-put-TextString attrib val)
               )
            )
          )
        )
        (setq i (1+ i))
     )
  )
  (princ)
)
Quote

hudster

  • Gator
  • Posts: 2848
Attribute editor
« Reply #6 on: June 29, 2004, 10:44:35 AM »
Express tools GATTE command will let you do this.

Select the attribute you wish to cahnge, but when it asks you if you want to process them all say no, then select the ones you wish to change and hey presto, job done.
Revit BDS 2017, 2016, 2015, 2014, AutoCAD 2017, 2016, Navisworks 2017, 2016, BIM360 Glue

Columbia

  • Guest
Attribute editor
« Reply #7 on: June 29, 2004, 11:21:51 AM »
Try this one...

Code: [Select]

(defun c:test (/ ss tag val attributeList attrib i oBlock)
  (setq tag (getstring "\nWhich attribute (tag) do you want to edit?  "))
  (setq val (getstring "\nWhat is the new value?  "))
  (if (and tag (/= tag "") val (/= val ""))
    (while
      (progn
        (princ "\nSelect block objects...")
        (setq ss (ssget (list (cons 0 "INSERT"))))
      )
      (setq i 0)
      (repeat (sslength ss)
         (setq oBlock (vlax-ename->vla-object (ssname ss i)))
         (if (= (vla-get-HasAttributes oBlock) :vlax-true)
           (progn
              (setq attributeList
                (vlax-safearray->list
                  (variant-value (vla-GetAttributes oBlock))
                )
              )
              (foreach attrib attributeList
                 (if (= (vla-get-TagString attrib) tag)
                   (vla-put-TextString attrib val)
                 )
              )
            )
          )
          (setq i (1+ i))
      )
    )
  )
  (princ)
)

Anonymous

  • Guest
Attribute editor
« Reply #8 on: July 01, 2004, 08:30:09 AM »
See  Annosuit2004 or AttributeSuit2004 in http://www.ikozmos.com

Mark

  • Custom Title
  • Seagull
  • Posts: 28762
Attribute editor
« Reply #9 on: July 01, 2004, 08:53:53 AM »
Quote from: Anonymous
See  Annosuit2004 or AttributeSuit2004 in http://www.ikozmos.com


I have no problem with you peddling your wares on TheSwamp as long as you register.

A couple of question regarding your programs;
why use RAR for compression?

AnnoSuit2004;
"trail mode expired at: 20040630"

I didn't try anymore after this!!

IMO, you should use your name or company name as an email address, not a movie characters name, sounds more professional.
TheSwamp.org  (serving the CAD community since 2003)

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
Attribute editor
« Reply #10 on: July 01, 2004, 10:03:21 AM »
Quote from: Mark Thomas
Quote from: Anonymous
See  Annosuit2004 or AttributeSuit2004 in http://www.ikozmos.com


I have no problem with you peddling your wares on TheSwamp as long as you register.


Well I kinda do .. but it IS your site so do as you wish ...
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie

nivuahc

  • Guest
Attribute editor
« Reply #11 on: July 01, 2004, 10:05:35 AM »
ditto what Keith said...

Mark

  • Custom Title
  • Seagull
  • Posts: 28762
Attribute editor
« Reply #12 on: July 01, 2004, 10:47:08 AM »
Quote from: Keith
Quote from: Mark Thomas
Quote from: Anonymous
See  Annosuit2004 or AttributeSuit2004 in http://www.ikozmos.com


I have no problem with you peddling your wares on TheSwamp as long as you register.


Well I kinda do .. but it IS your site so do as you wish ...

But you are registered Keith.  :?
TheSwamp.org  (serving the CAD community since 2003)

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
Attribute editor
« Reply #13 on: July 01, 2004, 11:40:39 AM »
I think perhaps you missed my point ... Personally I would prefer that this be kept a professional meeting place free from blatent advertising designed to draw us into their web. I would prefer to hear users comments on their experience with a particular bit of software than to see a company tout it's wares, as they will frequently tell you all of the good and none of the bad. Once you have the darn thing it is too late. But, if you think it is ok, then who am I to complain
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie