ILoveMadoka Posted April 3, 2023 Share Posted April 3, 2023 (edited) I'm wanting to select all objects where the linetype is not Continuous, Center or Dashed. I want to pass on objects without a linetype assignment. This is what I have but my syntax in messed up (defun c:FLT () (setq LT1 (ssget "_X" '((6 . "<NOT") ("DASHED" "CENTER" "CONTINUOUS") )) all (ssname LT1 0) ) (princ) ) Am I even close?? Edited April 3, 2023 by ILoveMadoka Quote Link to comment Share on other sites More sharing options...
Steven P Posted April 3, 2023 Share Posted April 3, 2023 (edited) This is a great reference: http://lee-mac.com/ssget.html Looking through that and the 'not' example (ssget '((0 . "LINE") (-4 . "<NOT") (62 . 256) (-4 . "NOT>"))) and I think you'll need an OR in the NOT to create the list of exclusions: (setq ss (ssget "_X" '((0 . "LINE") (-4 . "<NOT") (-4 . "<OR")(6 . "DASHED")(6 . "CENTER")(6 . "CONTINUOUS")(-4 . "OR>") (-4 . "NOT>")))) EDIT Should be: (setq ss (ssget "_X" '((-4 . "<NOT") (-4 . "<OR")(6 . "DASHED")(6 . "CENTER")(6 . "CONTINUOUS")(-4 . "OR>") (-4 . "NOT>")))) (see below) Edited April 3, 2023 by Steven P Quote Link to comment Share on other sites More sharing options...
Tharwat Posted April 3, 2023 Share Posted April 3, 2023 (setq s (ssget '((0 . "LINE") (-4 . "<NOT") (6 . "DASHED,CENTER,CONTINUOUS") (-4 . "NOT>")))) 1 Quote Link to comment Share on other sites More sharing options...
ronjonp Posted April 3, 2023 Share Posted April 3, 2023 And this: (setq ss (ssget "_X" '((0 . "LINE") (6 . "~DASHED") (6 . "~CENTER") (6 . "~CONTINUOUS")))) 1 Quote Link to comment Share on other sites More sharing options...
ILoveMadoka Posted April 3, 2023 Author Share Posted April 3, 2023 What if it's not a line? are you forced to do something like this? (0 . "LINE,ARC,CIRCLE,LWPOLYLINE,SPLINE") Does that cover ALL object types? these two lines both worked for LINES: (setq ss01 (ssget "_X" '((0 . "LINE") (-4 . "<NOT") (-4 . "<OR")(6 . "DASHED")(6 . "CENTER")(6 . "CONTINUOUS")(-4 . "OR>") (-4 . "NOT>")))) (setq ss03 (ssget "_X" '((0 . "LINE") (6 . "~DASHED") (6 . "~CENTER") (6 . "~CONTINUOUS")))) the other did not (for me) Quote Link to comment Share on other sites More sharing options...
ILoveMadoka Posted April 3, 2023 Author Share Posted April 3, 2023 So this is where I am and it is still only working for lines and polylines (not splines, lwpolylines, arcs or circles) (defun c:FLT () (setq ssx (ssget "_X" '((0 . "LINE,ARC,CIRCLE,LWPOLYLINE,SPLINE") (6 . "~DASHED") (6 . "~CENTER") (6 . "~CONTINUOUS")))) (princ) ) Quote Link to comment Share on other sites More sharing options...
ronjonp Posted April 3, 2023 Share Posted April 3, 2023 Perhaps remove the entity filter ( 0 ). (setq ss (ssget "_X" '((6 . "~DASHED") (6 . "~CENTER") (6 . "~CONTINUOUS")))) Quote Link to comment Share on other sites More sharing options...
ILoveMadoka Posted April 3, 2023 Author Share Posted April 3, 2023 This works with one issue for me. It's selecting text/mtext (linetype display in properties is BYLAYER) (defun c:FLT () (setq dx2 (ssget "_X" '((6 . "~DASHED") (6 . "~CENTER") (6 . "~CONTINUOUS")))) (princ) ) If I can remove the text from the ss I'm golden. Sorry to be difficult (thank you all for the input!!) Quote Link to comment Share on other sites More sharing options...
ronjonp Posted April 3, 2023 Share Posted April 3, 2023 Perhaps? (ssget "_X" '((6 . "~DASHED") (6 . "~CENTER") (6 . "~CONTINUOUS")(6 . "~BYLAYER"))) Quote Link to comment Share on other sites More sharing options...
ILoveMadoka Posted April 3, 2023 Author Share Posted April 3, 2023 (edited) For closure.. (defun c:FLT3 () (setq dx2 (ssget "_X" '((0 . "ARC,SPLINE,CIRCLE,HATCH,LINE,LWPOLYLINE,POINT,POLYLINE,SOLID,ELLIPSE,TRACE") (-4 . "<NOT") (-4 . "<OR")(6 . "DASHED")(6 . "CENTER")(6 . "CONTINUOUS")(-4 . "OR>") (-4 . "NOT>")))) (princ) ) Again, thank you all! ps: ronjonp - that worked too! Edited April 3, 2023 by ILoveMadoka Quote Link to comment Share on other sites More sharing options...
ronjonp Posted April 3, 2023 Share Posted April 3, 2023 (edited) 2 minutes ago, ILoveMadoka said: For closure.. (defun c:FLT3 () (setq dx2 (ssget "_X" '((0 . "ARC,SPLINE,CIRCLE,HATCH,LINE,LWPOLYLINE,POINT,POLYLINE,SOLID,ELLIPSE,TRACE") (-4 . "<NOT") (-4 . "<OR")(6 . "DASHED")(6 . "CENTER")(6 . "CONTINUOUS")(-4 . "OR>") (-4 . "NOT>")))) (princ) ) Again, thank you all! That won't filter out Linetype BYLAYER items. You might as well use @Tharwat example.. and include "BYLAYER" in the list. Edited April 3, 2023 by ronjonp Quote Link to comment Share on other sites More sharing options...
Steven P Posted April 3, 2023 Share Posted April 3, 2023 I think I should go back up and take out 'line' from my answer above - causing some confusion for me just copy and pasting without thinking Quote Link to comment Share on other sites More sharing options...
Steven P Posted April 3, 2023 Share Posted April 3, 2023 (edited) 30 minutes ago, ILoveMadoka said: This works with one issue for me. It's selecting text/mtext (linetype display in properties is BYLAYER) (defun c:FLT () (setq dx2 (ssget "_X" '((6 . "~DASHED") (6 . "~CENTER") (6 . "~CONTINUOUS")))) (princ) ) If I can remove the text from the ss I'm golden. Sorry to be difficult (thank you all for the input!!) This one, put (0 . "*text") in your list of 'NOT's, * being a wildcard (so gets text, mtext and rtext) (defun c:FLT () (setq dx2 (ssget "_X" '((0. "~*TEXT") (6 . "~DASHED") (6 . "~CENTER") (6 . "~CONTINUOUS")))) (princ) ) Edited April 3, 2023 by Steven P Quote Link to comment Share on other sites More sharing options...
ILoveMadoka Posted April 6, 2023 Author Share Posted April 6, 2023 Wanted to be sure to say THANK YOU for all the help!! 1 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.