open plines

Discussion in 'AutoCAD' started by jlw-, Jun 9, 2004.

  1. jlw-

    jlw- Guest

    I'm trying to crate a lsp routine which will find oipen plines and then change there layer and color. This is what I have so far. My issue is how do you determine if the pline is open.

    (DEFUNv C:
    (setq cmd (getvar "cmdecho"))
    (setvar "cmdecho" 0)
    (ssget "x" '(list (cons 8 "RM$")(0 ."POLYLINE,LWPOLYLINE"))
    )
    (while (setq
    (setvar "cmdecho" cmd)
    (princ)
    )

    Any help would be greatly appreciated.
     
    jlw-, Jun 9, 2004
    #1
  2. jlw-

    Jeff Mishler Guest

    This newsgroup is for visual basic for applications, not lisp. So in the
    future please just post lisp questions in the plain customization newsgroup.
    Thanks. Now to answer your question:

    Code:
    (DEFUN C:pline-change (/ cmdss)
    (setq cmd (getvar "cmdecho")
    count -1)
    (setvar "cmdecho" 0)
    (if (setq ss (ssget "x" '(list (cons 8 "RM$")(0 ."POLYLINE,LWPOLYLINE"))))
    (while (< (setq count (1+ count)) (sslength ss));step thru ss
    (setq ent (entget (ssname ss count)));get each entity
    (if (not (= (logand 1 (cdr (assoc 70 ent))) 1));check for open
    (progn
    ;make revisions to pline here
    ;
    )
    )
    )
    )
    (setvar "cmdecho" cmd)
    (princ);exit quietly
    )
    
    Jeff


    change there layer and color. This is what I have so far. My issue is how do
    you determine if the pline is open.
     
    Jeff Mishler, Jun 10, 2004
    #2
  3. jlw-

    Jeff Mishler Guest

    Oops! i didn't catch the little error in the original post.
    (if (setq ss (ssget "x" '(list (cons 8 "RM$")(0 ."POLYLINE,LWPOLYLINE"))))
    should be:
    (if (setq ss (ssget "x" (list (cons 8 "RM$")'(0 ."POLYLINE,LWPOLYLINE"))))

    Jeff
     
    Jeff Mishler, Jun 10, 2004
    #3
  4. jlw-

    jlw- Guest

    Thanks,

    I apologize I did not realize I was on the wrong site.
     
    jlw-, Jun 10, 2004
    #4
  5. jlw-

    Jürg Menzi Guest

    Hi jlw

    '((0 . "POLYLINE,LWPOLYLINE") (-4 . "<NOT") (-4 . "&") (70 . 1) (-4 . "NOT>")))

    Cheers
     
    Jürg Menzi, Jun 10, 2004
    #5
  6. jlw-

    Jeff Mishler Guest

    Hi Jurg,
    This doesn't work for plines with the plinegen set to 'on'. Assoc 70 would
    be 129 if it were closed and had plinegen on.....and if it's a heavy pline
    there are many others it could be.

    Jeff
     
    Jeff Mishler, Jun 10, 2004
    #6
  7. jlw-

    Jürg Menzi Guest

    Hi Jeff
    I don't think so...
    The filter uses the bitwise operator with the 70 group.

    Cheers
     
    Jürg Menzi, Jun 10, 2004
    #7
  8. jlw-

    Jeff Mishler Guest

    Oops, I didn't notice the "&" in there.....sorry 'bout that!

    Have a great day,
    Jeff
     
    Jeff Mishler, Jun 10, 2004
    #8
  9. jlw-

    Jürg Menzi Guest

    Jeff
    Thx, evening will be enough...:cool:

    Cheers
     
    Jürg Menzi, Jun 10, 2004
    #9
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.