Jump to content

Sin Tax - (ssget) issue


ILoveMadoka

Recommended Posts

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

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

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)

Link to comment
Share on other sites

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)
)

 

Link to comment
Share on other sites

Perhaps remove the entity filter ( 0 ).

(setq ss (ssget "_X" '((6 . "~DASHED") (6 . "~CENTER") (6 . "~CONTINUOUS"))))

 

Link to comment
Share on other sites

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!!)

Link to comment
Share on other sites

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

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

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

Link to comment
Share on other sites

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 by Steven P
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...