Author Topic: Filter command - Closed Polyline Option?  (Read 3674 times)

0 Members and 1 Guest are viewing this topic.

quamper

  • Guest
Filter command - Closed Polyline Option?
« on: August 18, 2008, 12:10:57 PM »
In quick select you can check for Closed/Non-Closed polylines. Can you check for that with the Filter Command/Dialog?




rkmcswain

  • Swamp Rat
  • Posts: 978
Re: Filter command - Closed Polyline Option?
« Reply #1 on: August 18, 2008, 01:12:21 PM »
I don't think so.

You can do it with lisp like this:

Code: [Select]
;;; select closed polylines
(ssget '((0 . "POLYLINE,LWPOLYLINE")(-4 . "&")(70 . 1)))

quamper

  • Guest
Re: Filter command - Closed Polyline Option?
« Reply #2 on: August 18, 2008, 01:47:07 PM »
Is there not a DXF code for Open Polylines? I just looked in the DXF reference and I don't see anything, but I might be missing something obvious.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Filter command - Closed Polyline Option?
« Reply #3 on: August 18, 2008, 01:49:27 PM »
DXF 70 8-)
Quote
Polyline flag (bit-coded); default is 0:
1 = Closed; 128 = Plinegen
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

quamper

  • Guest
Re: Filter command - Closed Polyline Option?
« Reply #4 on: August 18, 2008, 02:32:54 PM »
Hmm  :-( .. ok I'm still not getting it for some reason.

I draw 2 new polylines in an empty drawing. 1 of which is closed and the other is not.

Code: [Select]
(ssget "x" '((0 . "LWPOLYLINE")))
That selects both polylines in the drawing no problem what so ever.

however nothing else (including samples already posted) I've tried will select just one or the other. Everything will either select both or nothing


Spike Wilbury

  • Guest
Re: Filter command - Closed Polyline Option?
« Reply #5 on: August 18, 2008, 02:42:00 PM »
Did you tried with:


;; close
(ssget '((0 . "POLYLINE,LWPOLYLINE")(-4 . "=")(70 . 1)))

;; open
(ssget '((0 . "POLYLINE,LWPOLYLINE")(-4 . "=")(70 . 0)))

quamper

  • Guest
Re: Filter command - Closed Polyline Option?
« Reply #6 on: August 18, 2008, 02:45:27 PM »
Did you tried with:


;; close
(ssget '((0 . "POLYLINE,LWPOLYLINE")(-4 . "=")(70 . 1)))

;; open
(ssget '((0 . "POLYLINE,LWPOLYLINE")(-4 . "=")(70 . 0)))

ARG! That's what I was trying  :cry:, but I had overlooked the fact that .. somehow the closed one changed to an open one, hence it not working right.

Sorry. That's exactly what I was looking for. Thanks for being patient  :angel:

Jeff_M

  • King Gator
  • Posts: 4094
  • C3D user & customizer
Re: Filter command - Closed Polyline Option?
« Reply #7 on: August 18, 2008, 02:46:58 PM »
That will not work when PLINEGEN is True.....you must test for the Bitwise 1 (as R.K. suggested):
Code: [Select]
;;get all lwplines
(setq ss (ssget "x" '((0 . "LWPOLYLINE"))))
;;get only closed lwplines
(setq ssclosed (ssget "x" '((0 . "LWPOLYLINE")(-4 . "&")(70 . 1))))
;; get only open lwplines
(setq ssopen (ssget "x" '((0 . "LWPOLYLINE")(-4 . "<NOT")(-4 . "&")(70 . 1)(-4 . "NOT>"))))

rkmcswain

  • Swamp Rat
  • Posts: 978
Re: Filter command - Closed Polyline Option?
« Reply #8 on: August 18, 2008, 05:25:40 PM »
Quote from: Quamper
    (ssget "x" '((0 . "LWPOLYLINE")))
That selects both polylines in the drawing no problem what so ever.
however nothing else (including samples already posted) I've tried will select just one or the other. Everything will either select both or nothing

You must have missed this one   :wink:



quamper

  • Guest
Re: Filter command - Closed Polyline Option?
« Reply #9 on: August 19, 2008, 08:40:15 AM »
Quote from: Quamper
    (ssget "x" '((0 . "LWPOLYLINE")))
That selects both polylines in the drawing no problem what so ever.
however nothing else (including samples already posted) I've tried will select just one or the other. Everything will either select both or nothing

You must have missed this one   :wink:
Well I was having problems with that for the same reason.

While the following that you posted works for closed polylines
Code: [Select]
(ssget '((0 . "POLYLINE,LWPOLYLINE")(-4 . "&")(70 . 1)))
changing the 70 . 1 to 70 . 0 doesn't work for open polylines.

But really that would have gotten me on the right track if I hadn't screwed up my sample I was working with  :-o