designerstuart Posted August 4, 2014 Share Posted August 4, 2014 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 Quote Link to comment Share on other sites More sharing options...
rkmcswain Posted August 4, 2014 Share Posted August 4, 2014 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 Quote Link to comment Share on other sites More sharing options...
designerstuart Posted August 6, 2014 Author Share Posted August 6, 2014 thank you - works perfectly Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.