Searching Attributes

Scott

Usenet Archive
Joined
Feb 29, 2000
Messages
606
Reaction score
0
Hi everybody!

I was wondering if it is possible to search for a specific attribute in an open drawing by creating a table of all the attributes contained in the drawing and then using the member function to search the table?

This is what I have so far:

(WHILE (SETQ ALIST (TBLNEXT "ATTRIBUTE" (NULL ALIST)))
(SETQ ANLIST (CONS (CDR (ASSOC 2 ALIST)) ANLIST))
)

(REVERSE ANLIST)

(SETQ ALSEARCH (MEMBER "DWGNO" ANLIST))

This doesn't seem to work, "attribute" isn't a valid table function.

Thanks for the help
 
You may want to rethink exactly what you want to do.
In other words what does "a specific attribute" mean?
"attributes" or "attribute references" which is what I think you really mean, are not in the 'drawing' they are in 'block references' which are in the 'drawing'. And as you discovered by trying (good for you), there is no 'attributes' table. (you would have discovered that also by reading the help file on "tables")

my guess is that you have a specific block which has a specific attribute tag in which you're interested, possibly to extract the 'value' contained in that tag or who knows what you want to do with it exactly, once you've 'found' it.

you can collect the blockreferences from the drawing with a filtered selection set or iteration then step though those with entnext or vla methods to get the specific attribute tag you're looking for and then do 'what ever' with them..

hth
Mark

Scott said:
Hi everybody!

I was wondering if it is possible to search for a specific attribute in an open drawing by creating a table of all the attributes contained in the

why collect *all* attributes if it's only certain ones you want? eg: select only the block names you're looking for etc
drawing and then using the member function to search the table?

as your code demonstrates you know, member searches a list not a table
This is what I have so far:

(WHILE (SETQ ALIST (TBLNEXT "ATTRIBUTE" (NULL ALIST)))
(SETQ ANLIST (CONS (CDR (ASSOC 2 ALIST)) ANLIST))
)

(REVERSE ANLIST)

(SETQ ALSEARCH (MEMBER "DWGNO" ANLIST))

This doesn't seem to work, "attribute" isn't a valid table function.

Thanks for the help

kudos to you for making an effort !!!
 

Latest threads

Back
Top