pljoin.lsp

Discussion in 'AutoCAD' started by Joe, May 10, 2006.

  1. Joe

    Joe Guest

    I used for years, quite happily, a routine PLJOIN.LSP (c)1999 by Autodesk,
    Inc. in Acad2000. It was a very quick way of joining a number of line,
    pline, arc, etc, entities into a polyline. With a two key alias the moves
    were: [PJ-Enter-Select entities-Enter-Enter]

    Our office has recently moved to 2006 and pljoin fails about 95% of the
    time. We are forced to use Polyline Edit which is twice as many keystrokes
    [PE-Enter-M-Enter-Select entities-Enter-J-Enter-Enter] and just doesn't
    seem to flow as well. It may seem a small thing, but after years of using
    pljoin I seem to always stumble over the PEdit sequence.

    So my theoretical question is: Why does pljoin fail in '06? What is so
    different about the drawn entities?
    My practical questions are: Has anyone modified the routine to work in the
    '04-'06 series (and where can I find it)? And, if it hasn't been done yet,
    can it be, practically -and I suppose- legally? My lsp skills are very
    rudimentary; would someone be willing to take this on?

    Thanks,
    Joe
     
    Joe, May 10, 2006
    #1
  2. Joe

    Pete Guest

    I use this but you don't have the option to select entities so the results
    may be a bit unpredictable if there are crossing entities. All you need to
    do is select any entity in the group you wish to convert and it will convert
    all connected entities into one polyline. It will only join lines, arcs,
    and polylines. I have noticed that it has slowed down considerably in some
    instances in acad 2006.

    Pete

    (defun c:pj ()
    (setq closed 1)
    (while closed
    (while (not (setq ent (entsel "\nSelect object to convert: "))))
    (setq elt (entget (car ent)))
    (if (or (or
    (= (cdr (assoc 70 elt)) 1)
    (= (cdr (assoc 0 elt)) "CIRCLE"))
    (= (cdr (assoc 42 elt)) (* 2 PI)))
    ;
    (alert "OBJECT IS CLOSED
    \nCAN'T JOIN OBJECTS") ;repeat loop
    (setq closed nil); exit loop
    );if
    );while
    ;
    ;(prompt "\nSelect objects to join: ")
    (setq ss (ssget "X"))
    (cond
    ((or (= (cdr (assoc 0 elt)) "LINE") (= (cdr (assoc 0 elt)) "ARC"))
    (command"PEDIT" ent "Y" "J" ss "" "")
    )
    ((or (= (cdr (assoc 0 elt)) "LWPOLYLINE") (= (cdr (assoc 0 elt))
    "POLYLINE"))
    (command ".pedit" ent "j" ss "" "")
    )
    (T (alert "Object selected cannot be converted"))
    )
    (princ)
    )
     
    Pete, May 11, 2006
    #2
  3. Joe

    R.K. McSwain Guest

    Maybe this would help.

    (defun c:pljoin ()
    (setvar "peditaccept" 1)
    (princ "\nSelect objects ")
    (setq sset (ssget))
    (command "._pedit" "_M" sset "" "_J" "0.0" "")
    )
     
    R.K. McSwain, May 11, 2006
    #3
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.