Jump to content

Recommended Posts

Posted (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 by ILoveMadoka
Posted (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 by Steven P
Posted
(setq s (ssget '((0 . "LINE") (-4 . "<NOT") (6 . "DASHED,CENTER,CONTINUOUS") (-4 . "NOT>"))))

 

  • Like 1
Posted

And this:

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

 

  • Like 1
Posted

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)

Posted

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

 

Posted

Perhaps remove the entity filter ( 0 ).

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

 

Posted

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

Posted

Perhaps?

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

 

Posted (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 by ILoveMadoka
Posted (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 by ronjonp
Posted

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

Posted (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 by Steven P
Posted

Wanted to be sure to say THANK YOU for all the help!!

  • Like 1

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