Check polyline if closed.

BillZ

Usenet Archive
Joined
Jul 9, 2003
Messages
1,001
Reaction score
0
R14 Autolisp:

I am trying to remember what I once saw how this is done. I think using the boole or rem function to find if the assoc 70 has the one within the number that indicates a "closed" pline.

TIA

Bill
 
; [ename] - light weight/heavy weight polyline
;return: T if closed, nil otherwise
(defun isPolyClosed (ename)
(= 1 (logand 1 (cdr (assoc 70 (entget ename)))))
)

BillZ said:
R14 Autolisp:
I am trying to remember what I once saw how this is done. I think using the boole or rem
function to find if the assoc 70 has the one within the number that indicates a "closed" pline.
 
Thanks Jason.
I knew it was one of those little used (for me anyway) functions. :)

<<<<
 Bill
 
or u can use
(= (rem (cdr (assoc 70 (entget ename))) 2) 1))

BillZ said:
R14 Autolisp:
I am trying to remember what I once saw how this is done. I think using the boole or rem function
to find if the assoc 70 has the one within the number that indicates a "closed" pline.
 
Thanks Mark,
But logand looks much more impressive in my code. :^)

Bill
 

Latest threads

Back
Top