teknomatika Posted September 14, 2020 Posted September 14, 2020 Hi, I need and thank you in advance for your help. I need to select in a drawing all types of lines except continuous. I tried to use quick select but the tool does not seem to distinguish between this style and the by layer. Thanks! Quote
Tharwat Posted September 14, 2020 Posted September 14, 2020 (edited) (setq s (ssget '((0 . "*LINE") (6 . "~Continuous")))) Edited September 14, 2020 by Tharwat 1 Quote
teknomatika Posted September 14, 2020 Author Posted September 14, 2020 (edited) Tharwat, thanks for the help. It seems to work for the continuous type but not yet the continuous defined as bylayer. I wish that these too are included in the selection. (defun c:notc (/ s) (setq s (ssget '((0 . "*LINE") (6 . "~Continuous")))) (command "_move" s) );;or copyclip or copy;; (princ) Edited September 14, 2020 by teknomatika code correction Quote
Tharwat Posted September 14, 2020 Posted September 14, 2020 Then you need to cycle through the layer table and make a list of the layer names that with the Line Type Continuous. Try it yourself then let me know. Quote
teknomatika Posted September 14, 2020 Author Posted September 14, 2020 9 minutes ago, Tharwat said: Then you need to cycle through the layer table and make a list of the layer names that with the Line Type Continuous. Try it yourself then let me know. Tharwat, thanks. But, as we say here, "this is too much sand for my truck" . I appreciate help to implement this part. Quote
Tharwat Posted September 14, 2020 Posted September 14, 2020 (defun c:notc (/ r l n s) (setq r "") (while (setq l (tblnext "LAYER" (null l))) (or (wcmatch (setq n (cdr (assoc 2 l))) "*|*") (and (= (cdr (assoc 6 l)) "Continuous") (setq r (strcat r n ",")) ) ) ) (if (setq s (ssget (list '(0 . "*LINE") '(-4 . "<NOT") '(-4 . "<OR") (cons 8 r) '(6 . "Continuous") '(-4 . "OR>") '(-4 . "NOT>") ) ) ) ;; do your stuff here. Move , copy ... etc as you indicated into your previous post ) (princ) ) Quote
Roy_043 Posted September 14, 2020 Posted September 14, 2020 @Tharwat That is not going to work properly. Objects on 'Continuous' layers may have a 'non-Continuous' linetype. Quote
teknomatika Posted September 14, 2020 Author Posted September 14, 2020 1 hour ago, Tharwat said: (defun c:notc (/ r l n s) (setq r "") (while (setq l (tblnext "LAYER" (null l))) (or (wcmatch (setq n (cdr (assoc 2 l))) "*|*") (and (= (cdr (assoc 6 l)) "Continuous") (setq r (strcat r n ",")) ) ) ) (if (setq s (ssget (list '(0 . "*LINE") '(-4 . "<NOT") '(-4 . "<OR") (cons 8 r) '(6 . "Continuous") '(-4 . "OR>") '(-4 . "NOT>") ) ) ) ;; do your stuff here. Move , copy ... etc as you indicated into your previous post ) (princ) ) Tharwat, tanks. Not work. What will I have done wrong? (defun c:notc (/ r l n s) (setq r "") (while (setq l (tblnext "LAYER" (null l))) (or (wcmatch (setq n (cdr (assoc 2 l))) "*|*") (and (= (cdr (assoc 6 l)) "Continuous") (setq r (strcat r n ",")) ) ) ) (if (setq s (ssget (list '(0 . "*LINE") '(-4 . "<NOT") '(-4 . "<OR") (cons 8 r) '(6 . "Continuous") '(-4 . "OR>") '(-4 . "NOT>") ) ) ) (command "_move" s);; do your stuff here. Move , copy ... etc as you indicated into your previous post ) (princ) ) Quote
Tharwat Posted September 14, 2020 Posted September 14, 2020 44 minutes ago, Roy_043 said: @Tharwat That is not going to work properly. Objects on 'Continuous' layers may have a 'non-Continuous' linetype. What's is your proposition ? Quote
Tharwat Posted September 14, 2020 Posted September 14, 2020 24 minutes ago, teknomatika said: Tharwat, tanks. Not work. What will I have done wrong? Which part that is not working? The move command or the selection set ? Quote
teknomatika Posted September 14, 2020 Author Posted September 14, 2020 27 minutes ago, Tharwat said: Which part that is not working? The move command or the selection set ? From what I can see, the selection set. Quote
Roy_043 Posted September 14, 2020 Posted September 14, 2020 1 hour ago, Tharwat said: What's is your proposition ? (defun c:notc (/ lst ss str) (setq str "") (while (setq lst (tblnext "LAYER" (null lst))) (if (= (cdr (assoc 6 lst)) "Continuous") (setq str (strcat str (cdr (assoc 2 lst)) ",")) ) ) (if (setq ss (ssget (list '(0 . "*LINE") '(-4 . "<AND") '(-4 . "<NOT") '(-4 . "<AND") '(6 . "ByLayer") (cons 8 str) '(-4 . "AND>") '(-4 . "NOT>") '(6 . "~Continuous") '(-4 . "AND>") ) ) ) (print (sslength ss)) ) (princ) ) Quote
Tharwat Posted September 14, 2020 Posted September 14, 2020 @Roy_043 I don't see any difference between yours and mine and I think excluding objects on the same layer with '(6 . "ByLayer ") does not make sense. @teknomatika Please upload a copy of the drawing you tested the codes on if you can and not any other drawing ? Quote
Lee Mac Posted September 14, 2020 Posted September 14, 2020 (edited) 7 minutes ago, Tharwat said: @Roy_043 I don't see any difference between yours and mine and I think excluding objects on the same layer with '(6 . "ByLayer ") does not make sense. An object whose layer linetype is set to Continuous will only exhibit Continuous linetype if the object linetype property is either set to Continuous or ByLayer, hence, to select everything except objects with Continuous linetype, you need to exclude those with object linetype property set to Continuous, and those with object linetype property set to ByLayer and whose layer linetype is set to Continuous. Your existing code will exclude objects residing on layers whose linetype is set to Continuous, but whose object linetype property may be set to something other than Continuous, therefore meaning that they should be included in the set. I hope this clarifies things. Edited September 14, 2020 by Lee Mac Quote
Roy_043 Posted September 14, 2020 Posted September 14, 2020 @Lee Mac Thanks. @Tharwat Test your code with the attached file.Linetype_test.dwg Quote
Tharwat Posted September 14, 2020 Posted September 14, 2020 6 minutes ago, Lee Mac said: Your existing code will exclude objects residing on layers whose linetype is set to Continuous, but whose object linetype property may be set to something other than Continuous, therefore meaning that they should be included in the set. Yes, and that's exactly what the OP wanted as you can see in below and as I got it that way. 6 hours ago, teknomatika said: Tharwat, thanks for the help. It seems to work for the continuous type but not yet the continuous defined as bylayer. I wish that these too are included in the selection. Quote
Tharwat Posted September 14, 2020 Posted September 14, 2020 5 minutes ago, Roy_043 said: @Tharwat Test your code with the attached file.Linetype_test.dwg Yes Roy I know without doing any test, let's wait for the OP and see if they meant that or it was unnecessarily but anyway, the goal is vague somehow and excepts the two ideas of the codes. Quote
Roy_043 Posted September 14, 2020 Posted September 14, 2020 37 minutes ago, Tharwat said: I don't see any difference between yours and mine and I think excluding objects on the same layer with '(6 . "ByLayer ") does not make sense. 14 minutes ago, Tharwat said: Yes Roy I know without doing any test. You are not making much sense here. Quote
teknomatika Posted September 15, 2020 Author Posted September 15, 2020 Tharwat and Roy_043, thanks! For what I want, it works. Effectively Selects all types of lines, except the type, continuous, even those defined as bylayer. Thank you both for your interest and help. Quote
teknomatika Posted December 21, 2020 Author Posted December 21, 2020 (edited) @ Tharwat and Roy_043 Olá. Eu volto ao assunto. A rotina tem sido muito útil, mas, por enquanto, acho que ela não filtra (exceto) as linhas definidas como "Por bloco". Na realidade, parece que estão incluídos na seleção, embora sejam do tipo "contínuo". Quando apropriado, agradeço sua ajuda. Obrigado! Edited December 21, 2020 by teknomatika 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.