Jump to content

ctrl+alt+a for select similar


designerstuart

Recommended Posts

hi all

 

i have found some code here to help me reinsert this command, but at present it is like any other lisp command, i.e. entered at the command line.

 

;;; Select Similar
;;; (based on a command found in a few versions of AutoCAD)
;;; written by Adam Wuellner <mailto:akw@gawab.com>
;;; all rights released

(defun c:selsim  (/ ss1 i ent filter_list type-layer filter sstemp)
 (if (not (setq ss1 (cadr (ssgetfirst))))
   (setq ss1 (ssget)))
 (setq i           0
       filter_list '())
 (repeat (sslength ss1)
   (setq ent (entget (ssname ss1 i))
         i   (1+ i))
   (setq type-layer (list (assoc 0 ent) (assoc 8 ent)))
   (if (not (member type-layer filter_list))
     (setq filter_list (cons type-layer filter_list))))
 (foreach filter  filter_list
   (princ (strcat "selecting all " (cdar filter) " entities on layer " (cdadr filter) "...\n"))
   (setq sstemp (ssget "X" filter))
   (setq ss1    (ss:union ss1 sstemp)
         sstemp nil))
 (sssetfirst nil ss1)
 (princ))

(defun ss:union  (ss1 ss2 / ename ss-smaller ss-larger c)
 (cond ((and ss1 ss2)
        (setq c 0)
        (if (< (sslength ss1) (sslength ss2))
          (setq ss-smaller ss1
                ss-larger ss2)
          (setq ss-larger ss1
                ss-smaller ss2))
        (while (< c (sslength ss-smaller))
          (setq ename (ssname ss-smaller c)
                c     (1+ c))
          (if (not (ssmemb ename ss-larger))
            (ssadd ename ss-larger)))
        ss-larger)
       (ss1 ss1)
       (ss2 ss2)
       (t nil)))

 

do you know how to change ctrl+shift+a from groups toggle to run this command?

 

thank you

Link to comment
Share on other sites

CUI > Shortcut Keys > Ctrl+Shift+A

Change the macro to:

 

^c^c(if (not c:selsim)(load"selsim")) selsim;

 

Make sure "selsim.lsp" is in your support file search path or pre-loaded

Link to comment
Share on other sites

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...