itacad Posted April 22, 2023 Posted April 22, 2023 Hi, after having obtained the selection of a certain number of objects (for example because they are positioned on a certain layer) scattered in a very large autocad file, it is possible to exclude from the selection those external to a selection window or, which is the same result, keep only those in a select window? Greetings Quote
BIGAL Posted April 22, 2023 Posted April 22, 2023 Using (ssget "WP" has the effect of selecting in a window or are you selecting a window as a second step. Quote
CyberAngel Posted April 24, 2023 Posted April 24, 2023 If you're using the QuickSelect command, you can include or exclude the objects you select in the current selection set, rather than the entire drawing. You can also append them to the current set. In other words, you can add or remove batches of objects from a set in multiple steps. You may need to plan out the sequence of steps more carefully, for instance selecting with a window before selecting by layer. Quote
tombu Posted April 25, 2023 Posted April 25, 2023 Lisp Macro I've used for that purpose for 10 years now: (load "SSimWin.lsp") SSimWin Select Similar within Window lisp function using SelectSimilar command by Alan J. Thompson, 2013.07.30. https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/select-similar-by-window-selection/m-p/4348047#M313697 ;| Select Similar within Window using SelectSimilar command by Alan J. Thompson, 2013.07.30. https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/select-similar-by-window-selection/m-p/4348047#M313697 (load "SSimWin.lsp") SSimWin |; (defun c:SSimWin (/ filter ss1 ss2 ss3 add i e) (setq filter (if (eq (getvar 'CVPORT) 1) (list (cons 410 (getvar 'CTAB))) '((410 . "Model")) ) ) (princ "\nSelect objects to select similar: ") (if (and (setq ss1 (ssget filter)) (progn (princ "\nSelect area to select similar object(s) within: ") (setq ss2 (ssget filter)) ) ) (progn (command "_.selectsimilar" ss1 "") (if (setq ss3 (ssget "_I" filter)) (progn (sssetfirst nil nil) (setq add (ssadd)) (repeat (setq i (sslength ss3)) (if (ssmemb (setq e (ssname ss3 (setq i (1- i)))) ss2) (setq add (ssadd e add)) ) ) (sssetfirst nil add) ) ) ) ) (princ) ) Thanks Alan! Quote
itacad Posted April 26, 2023 Author Posted April 26, 2023 Thank you! i will definitely try it! meanwhile, if it's interesting, googling I found the "WPS" lisp, very interesting https://www.cadforum.cz/en/download.asp?fileID=700 Quote
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.