Visual LISP, AutoLISP and General Customization

Visual LISP, AutoLISP and General Customization

Reply
*discussion.autodesk.com
Message 11 of 13 (115 Views)

Re: ssget "x" dynamic block

12-02-2007 09:17 AM in reply to: *discussion.autodesk.com
Thanks!

schreef in bericht news:5789143@discussion.autodesk.com...
I know this isn't exactly what your looking for but this will get you a list
of ename's for dyn blks with filtered name of your choice. If you want to
filter all dyn blks simply modify to eliminate effname.

(defun C:filterDyn (/ ss1 ss2 effn cnt)
(setq ss1 (ssget))
(setq effn "DamperRated"
cnt 0)
(repeat (sslength ss1)
(if (and (vlax-property-available-p
(vlax-ename->vla-object (ssname ss1 cnt)) 'IsDynamicBlock)
(equal effn (vla-get-effectivename
(vlax-ename->vla-object (ssname ss1 cnt))))
)
(setq ss2 (cons (ssname ss1 cnt) ss2))
)
(setq cnt (1+ cnt))
)
(princ)
)

B
*Joe Burke
Message 12 of 13 (115 Views)

Re: ssget "x" dynamic block

12-02-2007 09:33 AM in reply to: *discussion.autodesk.com
You're welcome

Joe
*M. Janmaat
Message 13 of 13 (115 Views)

Re: ssget "x" dynamic block

08-29-2008 05:33 AM in reply to: *discussion.autodesk.com
Thanks!!!

I got what I needed.

I used ' instead of `

M

"discussion.autodesk.com" schreef in bericht
news:5789016@discussion.autodesk.com...
Hi,

If I select a dynamic block it´s name can either be (2 . "*U65") or (2 .
"E_ARM0102") when it is actually the same block.

Now how can I filter the block E_ARM0102 in a way the altered ones wil also
be found.

(setq ss1 (ssget))
(ssget "x" (list (assoc 2 (entget (setq enm (ssname ss1 0)))))) ; Does not
find the dynamic altered block

(ssget "x" (list (cons 2 (vla-get-effectivename (vlax-ename->vla-object
(ssname ss1 0)))))) ; Only finds the unaltered blocks

I would like to be able to make a selectionset of both types of the same
block.

Hope someone can help.

M
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.