Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Block selection by attribute value

1,002 views
Skip to first unread message

joe eichenseer

unread,
Jun 22, 1998, 3:00:00 AM6/22/98
to

i know that this should be able to be done by LISP, but i have not yet
found the time to learn....

how can i select a series of blocks based upon attribute data -- such as
selecting room tags based on the value "toilet" within the tag?

thanks in advance!

joe eichenseer
weller architects


Terry W. Dotson

unread,
Jun 23, 1998, 3:00:00 AM6/23/98
to joe eichenseer

joe eichenseer wrote:

> how can i select a series of blocks based upon attribute data -- such as
> selecting room tags based on the value "toilet" within the tag?

ToolPac 4.0's Attribute Find will find text in selected tags and zoom center
for identification. Includes interactive selection set building
capabilities.

Follow the URL below to find out more.

Thanks, Terry

o---------------------------------------------o
| ToolPac 4.0, a 400+ function collection |
| of Power Tools for all AutoCAD users. |
| Visit http://www.dotsoft.com for details. |
o---------------------------------------------o

Cabot Eudaley

unread,
Jun 23, 1998, 3:00:00 AM6/23/98
to

Try the FILTER command. Allows you to 'filter' out things
you haven't specified. Plus you can save filters to use on
several drawings.

Cabot

joe eichenseer wrote:
>
> i know that this should be able to be done by LISP, but i have not yet
> found the time to learn....
>

> how can i select a series of blocks based upon attribute data -- such as
> selecting room tags based on the value "toilet" within the tag?
>

> thanks in advance!
>
> joe eichenseer
> weller architects

--
Mark Eudaley Engineers, Inc.
me...@ionet.net
(remove NOSPAM from reply to)

Terry W. Dotson

unread,
Jun 23, 1998, 3:00:00 AM6/23/98
to

Cabot Eudaley wrote:

> Try the FILTER command. Allows you to 'filter' out things
> you haven't specified. Plus you can save filters to use on
> several drawings.

But there is no 'Attribute Value' field, which is what the original poster
wanted to do. I won't deny that FILTER has merit (and problems), but I don't
think it works in this case.

Regards, Terry

Randy Kintzley

unread,
Jun 23, 1998, 3:00:00 AM6/23/98
to

Terry is correct the FILTER command falls short
in this instance.
Here's a simple lisp routine that seems to do the job.
Just save it to a lisp file and use appload to load it.
Then type "ATTSELECT" at the command line.
At the Select objects prompt enter all or select the
desired block inserts. Then specify tag and value
search criteria.

Hope that helps.
Thanks,
- Randy

Randy Kintzley
AutoCAD Express Tools Developer (formerly Bonus Tools)
randy.k...@autodesk.com
http://www.autodesk.com/expresstools

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun c:attselect ( / ss2 ss tag val n na)

(setq ss2 (ssadd))
(sssetfirst nil nil)
(princ "\nSelect blocks containing attributes.")
(if (setq ss (ssget '((0 . "INSERT") (66 . 1))))
(progn
(setq tag (getstring "\nEnter the TAG search specification <*>: ")
val (getstring T "\nEnter the VALUE search specification <*>:
")
);setq
(if (equal tag "")
(setq tag "*")
);if
(if (equal val "")
(setq val "*")
);if
(setq n 0)
(repeat (sslength ss)
(setq na (ssname ss n))
(if (sample_att_match na tag val)
(setq ss2 (ssadd na ss2))
);if
(setq n (+ n 1));setq
);repeat
(if (equal (getvar "cmdnames") "")
(sssetfirst ss2 ss2)
(command ss2)
);if
);progn then
);if
(princ)
);defun c:attselect

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun sample_att_match ( na tag val / e1 a b flag)
(while (and (setq na (entnext na))
(setq e1 (entget na))
(not (equal (cdr (assoc 0 e1)) "SEQEND"))
(not flag)
);and
(if (equal (cdr (assoc 0 e1)) "ATTRIB")
(progn
(setq a (cdr (assoc 2 e1)) ;2 is tag
b (cdr (assoc 1 e1)) ;1 is value
);setq
(if (and a
(wcmatch a tag)
b
(wcmatch b val)
);and
(setq flag T);then jump out of the loop
);if
);progn then attrib
);if
);while
flag
);defun sample_att_match

(princ "\nType ATTSELECT to run")
(princ)

Keith Biggs

unread,
Jun 23, 1998, 3:00:00 AM6/23/98
to

There is also a lisp routine called 'aselect' that I found. It will search
for a specified block based upon user defined attribute variables.

Keith

Cabot Eudaley wrote in message <359000D1...@ionet.net>...


>Try the FILTER command. Allows you to 'filter' out things
>you haven't specified. Plus you can save filters to use on
>several drawings.
>

>Cabot
>


joe eichenseer

unread,
Jun 24, 1998, 3:00:00 AM6/24/98
to

Thanks!!!
-joe

Randy Kintzley

unread,
Jun 24, 1998, 3:00:00 AM6/24/98
to

joe eichenseer wrote:
>
> Thanks!!!
> -joe

Thanks for saying thanks.
It makes it all worth while. :)

Dave Jones

unread,
Jun 25, 1998, 3:00:00 AM6/25/98
to

come on joe. You don't need to post 104 lines of the previous posts
just to say thanks. Try a (snip) every once in a while!

On Wed, 24 Jun 1998 08:24:41 -0600, joe eichenseer <wel...@flash.net>
wrote:

>Thanks!!!
>-joe
>
(snip)

joe eichenseer

unread,
Jun 25, 1998, 3:00:00 AM6/25/98
to

Thanks for your thanks, and sorry about the lack of snip... Sometimes I
loose my brain after staring at the screen too long! <g>

regards,
joe


0 new messages