Jump to content

SELECTION FILTER AND PROPERTIES CHANGE HELP


leonucadomi

Recommended Posts

 

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.

 

image.thumb.png.9e67082a78ce997fd56c00b857cc92f4.png

 

 

 

EXAMPLE.dwg

Link to comment
Share on other sites

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 by mhupp
Link to comment
Share on other sites

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

 

 

Link to comment
Share on other sites

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.

 

  • Like 1
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...