leonucadomi Posted August 23, 2022 Posted August 23, 2022 Hi everyone: I am trying to do the following in 3 steps. 1.- a line will be touched, it will store its line type in a variable. can be hidden, continuos, phantom .. no matter what 2.- then a selection will be made in a window of a group of lines and it will be filtered. Only lines with the linetype of the first object will be selected 3.- A line will be selected and all its properties will be copied to the group selected in the window. (Step 2) I do not want to use the quick selection of autocad. I hope someone can help me. EXAMPLE.dwg Quote
mhupp Posted August 23, 2022 Posted August 23, 2022 (edited) https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/select-similar-by-window-selection/m-p/4348047/highlight/true#M313697 This is basically what I use. --edit Added code for #3 (defun c:SSW (/ filter ss1 ss2 ss3 add i e) ;; Select Similar within Window ;; Uses core SelectSimilar command ;; Alan J. Thompson, 2013.07.30 (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) ;not need for matchprop ) ) ) ) (command "_.Matchprop" pause add "") ;only line added (princ) ) Edited August 23, 2022 by mhupp Quote
leonucadomi Posted August 23, 2022 Author Posted August 23, 2022 EXCELLENT EXACTLY WHAT I NEEDED, THANKS Quote
leonucadomi Posted August 24, 2022 Author Posted August 24, 2022 COULD BE MODIFIED TO MAKE IT DOUBLE? select two types of origin line same selection area of objects to change and two types of line to change Quote
leonucadomi Posted August 24, 2022 Author Posted August 24, 2022 The routine is interesting. Could you explain to me what each line does? please Quote
mhupp Posted August 24, 2022 Posted August 24, 2022 12 minutes ago, leonucadomi said: The routine is interesting. Could you explain to me what each line does? please It checks to see if your in paperspace for the filter. if you are it limits the selection to that tab. (SS1) The first selection is stored. You can select as many different entity's you want. (SS2) The second selection is also stored (SS3) Then it uses the first selection in select similar command. (this selects all similar items in model space or the current tab) it then checks to see if any entity's are in (SS3) and (SS2) if they are adds them to a new set called add. commented out it would then highlight those entity's (added code) then runs change prop command and updates add selection set. 1 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.