Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Selecting all dynamic blocks with a pick

6 REPLIES 6
SOLVED
Reply
Message 1 of 7
jonmcfarlandGY
1703 Views, 6 Replies

Selecting all dynamic blocks with a pick

Hi All,

 

I used to have a lisp routine that would allow me to pick one dynamic block and it would select all instances including the blocks that have become anonymous.  I can no longer find it.  Does anybody know what I'm referring to?

Thanks,

Jon

Please select "Accept as Solution" if your question was answered
6 REPLIES 6
Message 2 of 7
_Tharwat
in reply to: jonmcfarlandGY

If you are working on latest versions like 2012 and up , you can use select similar command , just a guess .
Message 3 of 7
BlackBox_
in reply to: jonmcfarlandGY

This should do what you're after:

 

(vl-load-com)

(defun c:FOO (/ ss blockName ss2)
  (if (setq ss (ssget ":S:E" '((0 . "INSERT"))))
    (progn
      (setq blockName (vla-get-effectivename
                        (vlax-ename->vla-object (ssname ss 0))
                      )
      )
      (setq ss2 (ssadd))
      (vlax-for x (vlax-get
                    (vla-get-activedocument (vlax-get-acad-object))
                    (if (= 1 (getvar 'cvport))
                      'paperspace
                      'modelspace
                    )
                  )
        (if (and (= "AcDbBlockReference" (vla-get-objectname x))
                 (= blockName (vla-get-effectivename x))
            )
          (setq ss2 (ssadd (vlax-vla-object->ename x) ss2))
        )
      )
      (sssetfirst nil ss2)
    )
  )
  (princ)
)

 

HTH



"How we think determines what we do, and what we do determines what we get."

Message 4 of 7
BlackBox_
in reply to: _Tharwat


@_Tharwat wrote:
If you are working on latest versions like 2012 and up , you can use select similar command , just a guess .

The SELECTSIMILAR Command does work on its own, but does not work from the context menu, particularly when said dynamic block instances have different visibility states (onyl those with the same visibility state are selected).

 

Cheers



"How we think determines what we do, and what we do determines what we get."

Message 5 of 7

Thank you guys, that's what I needed.

 

 

Jon

Please select "Accept as Solution" if your question was answered
Message 6 of 7
BlackBox_
in reply to: jonmcfarlandGY


@jonmcfarlandWS wrote:

Thank you guys, that's what I needed.

 

 


I'm happy to help. :beer:



"How we think determines what we do, and what we do determines what we get."

Message 7 of 7
PB1
Contributor
in reply to: BlackBox_

just what I was looking for!

thanks

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost