Check polyline if closed.

Discussion in 'AutoCAD' started by BillZ, Sep 17, 2003.

  1. BillZ

    BillZ Guest

    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
     
    BillZ, Sep 17, 2003
    #1
  2. ; [ename] - light weight/heavy weight polyline
    ;return: T if closed, nil otherwise
    (defun isPolyClosed (ename)
    (= 1 (logand 1 (cdr (assoc 70 (entget ename)))))
    )

    --

    -Jason
    Member of the Autodesk Discussion Forum Moderator Program


    function to find if the assoc 70 has the one within the number that indicates a "closed"
    pline.
     
    Jason Piercey, Sep 17, 2003
    #2
  3. BillZ

    BillZ Guest

    Thanks Jason.
    I knew it was one of those little used (for me anyway) functions. :)

    <<<<
     Bill
     
    BillZ, Sep 17, 2003
    #3
  4. BillZ

    Mark Guest

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

    to find if the assoc 70 has the one within the number that indicates a "closed" pline.
     
    Mark, Sep 17, 2003
    #4
  5. BillZ

    BillZ Guest

    Thanks Mark,
    But logand looks much more impressive in my code. :^)

    Bill
     
    BillZ, Sep 17, 2003
    #5
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.