Jump to content

SelectSimilar: for those running older version without it


alanjt

Recommended Posts

Per a thread someone posted about having issues with Select Similar.

 

Nothing special. I was killing time last night (finished my book and wasn't sure what to read next) and I thought I'd scratch this out for the less fortunate...

 

(defun c:SelectSimilar (/ ss lst)
 ;; Select Similar for those that don't have it
 ;; Alan J. Thompson, 07.06.10
 (vl-load-com)
 (if (setq ss (ssget))
   ((lambda (i / e ent)
      (while (setq e (ssname ss (setq i (1+ i))))
        (setq ent (entget e))
        (setq lst
               (cons (append '((-4 . "<AND"))
                             (vl-remove nil
                                        (mapcar (function
                                                  (lambda (n / p)
                                                    (if (setq p (assoc n ent))
                                                      (if (eq "*" (substr (cdr p) 1 1))
                                                        (cons n (strcat "`" (cdr p)))
                                                        p
                                                      )
                                                    )
                                                  )
                                                )
                                                '(0 2 
                                        )
                             )
                             '((-4 . "AND>"))
                     )
                     lst
               )
        )
      )
      (sssetfirst
        nil
        (setq ss (ssget "_X"
                        (append '((-4 . "<OR"))
                                (apply (function append) lst)
                                '((-4 . "OR>"))
                        )
                 )
        )
      )
    )
     -1
   )
 )
 (princ)
)

Link to comment
Share on other sites

  • 4 weeks later...
Nice Work, And now it is avaliable in Autocad 2011

 

Regards,

Thanks. It's pretty much always been available in the vertical options, and I think you can get it for 2010 in you are on subscription.

 

Nice one! Thanks for thinking of us
Thanks and you're welcome. As I said, I was killing time. I'll never use it (Civil 3D has it built in), but I wanted to help those running older versions of CAD.
Link to comment
Share on other sites

  • 1 month later...
  • 2 months later...

I take it there is no way of doing anything similar for us paupers who only have LT is there? At the moment I have to use the Qselect option which is time consuming when you have 100+ blocks and colleagues who use weird block names :ouch:

Link to comment
Share on other sites

I take it there is no way of doing anything similar for us paupers who only have LT is there? At the moment I have to use the Qselect option which is time consuming when you have 100+ blocks and colleagues who use weird block names :ouch:

Not without some kind of LT addon.

Link to comment
Share on other sites

  • 2 years later...
  • 5 years later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...