Results 1 to 8 of 8

Thread: Join all lines in a drawing

  1. #1
    Member
    Join Date
    2009-12
    Posts
    10
    Login to Give a bone
    0

    Default Join all lines in a drawing

    I'm working on converting drawings made with Autocad MEP to simple Autocad drawing. To do so, I make sections of the needed view, and explode them to a new Autocad drawing. The section tool is basicaly creating a huge number of line to render the 3D views in 2D. Don't know if that's really clear, but anyway.

    I am trying to join all the colinear line created by the section view tool. I'm not to good with programming, but is there a way that I could all the joignable line easily?

    The way I see it, I could create a LISP that selects every line one after another, and then on each of them individually, have the join command and select all the lines in the drawing applied that would work...might take a very long time though...

    Any ideas?

  2. #2
    Administrator Opie's Avatar
    Join Date
    2002-01
    Location
    jUSt Here (a lot)
    Posts
    9,106
    Login to Give a bone
    0

    Default Re: Join all lines in a drawing

    If the lines overlap, the overkill Express Tool can combine them together. It might also work with the co-linear lines aligned end to end.
    If you have a technical question, please find the appropriate forum and ask it there.
    You will get a quicker response from your fellow AUGI members than if you sent it to me via a PM or email.
    jUSt

  3. #3
    Member
    Join Date
    2009-12
    Posts
    10
    Login to Give a bone
    0

    Default Re: Join all lines in a drawing

    That does not seem to work so well unfortunatly...

  4. #4
    Certifiable AUGI Addict
    Join Date
    2001-03
    Location
    Tallahassee, FL USA
    Posts
    3,667
    Login to Give a bone
    0

    Default Re: Join all lines in a drawing

    Try this:
    Code:
     ;;; PLJOIN.LSP 2009+ Version
    ;;; Joins lines, arcs and polylines
    ;;; If only one object is selected it joins to all conected objects
    ;;; By Tom Beauford
    ;;; Macro   ^C^C^P(or C:pljoin (load "pljoin.lsp"));pljoin 
    (defun c:pljoin (/ cmdecho peditaccept ss addss)
      (setq cmdecho (getvar "cmdecho")
            peditaccept (getvar "peditaccept")
      )
      (setvar "cmdecho" 0)
      (setvar "peditaccept" 1)
      (princ "\nSelect object to join: ")
      (setq ss (ssget '((0 . "LINE,ARC,POLYLINE,LWPOLYLINE"))))
      (if (/= ss nil)
          (progn
     (if (= (sslength ss) 1)
              (progn
                (sssetfirst nil ss)
                (command "_.pedit" "_J" (ssget "X" '((0 . "LINE,ARC,POLYLINE,LWPOLYLINE"))) "" "")
              )
              (command "_.pedit" "_M" ss "" "_J" "0.0" "")
     )
          )
      )
      (setvar "cmdecho" cmdecho)
      (setvar "peditaccept" peditaccept)
      (princ)
    )
    ; Original Macro: ^C^C^P(ssget);pedit;m;p;;j;0.0;;

  5. #5
    Certifiable AUGI Addict ccowgill's Avatar
    Join Date
    2004-08
    Location
    Iron Station, NC
    Posts
    3,198
    Login to Give a bone
    0

    Default Re: Join all lines in a drawing

    Quote Originally Posted by elaurier View Post
    That does not seem to work so well unfortunatly...
    overkill works much better if you run set peditaccept to 0 before your run it.

  6. #6
    100 Club
    Join Date
    2004-12
    Posts
    126
    Login to Give a bone
    0

    Default Re: Join all lines in a drawing

    ;;; "Join Plines and Lines." This short
    ;;; routine joins multiple polylines and lines together as one, provided
    ;;; that the end points are at the same X,Y,Z coordinates.

    (defun C:PEE (/ SSET1)
    (princ "\nSelect lines to be joined. ")
    (if (setq SSET1 (ssget))
    (if (or
    (="POLYLINE" (cdr (assoc 0 (entget (ssname SSET1 0)))))
    (="LWPOLYLINE" (cdr (assoc 0 (entget (ssname SSET1 0)))))
    );;close or
    (command "PEDIT" SSET1 "J" SSET1 "" "X")
    (command "PEDIT" SSET1 "Y" "J" SSET1 "" "X");;inside if's else
    );;close inside if
    (princ "\nNothing selected. ")
    );;close outside if
    (princ)
    ) ;end PEE.lsp

  7. #7
    I could stop if I wanted to Mamma Jamma's Avatar
    Join Date
    2000-11
    Location
    Massachusetts
    Posts
    343
    Login to Give a bone
    0

    Default Re: Join all lines in a drawing

    How about Pedit/Multiple/all/Join? What it can join together, it will. You can set the fuzz distance to whatever seems reasonable (or 0, of course).

  8. #8
    Certifiable AUGI Addict
    Join Date
    2015-11
    Location
    Jo'burg SA
    Posts
    4,512
    Login to Give a bone
    0

    Default Re: Join all lines in a drawing

    I'd agree with Mamma Jamma and Opie.

    If you want polylines, the PEdit's already got a feature for joining lines, arcs and other polylines together - including using a "fuzzy" distance (no need to have endpoints exactly on each other).

    If you want lines overlapping & co-linear to become single lines the Express Tool's Delete Duplicates (or command OverKill) can do that - just set its fuzzy factor high enough if the lines aren't exactly on each other.

    In both instances the PEditAccept has reference as CCowGill's stated, but it may cause OverKill to fail - if there's any polylines selected. For PEdit it removes some of the prompts.

Similar Threads

  1. how to join lines between two junctions?
    By einbauen364392 in forum AutoCAD General
    Replies: 5
    Last Post: 2012-04-09, 10:18 PM
  2. How do I join lines?
    By ukdodger in forum AutoCAD 3D (2006 or below)
    Replies: 9
    Last Post: 2009-11-10, 02:30 PM
  3. join all lines
    By rwbaker54 in forum VBA/COM Interop
    Replies: 7
    Last Post: 2008-04-04, 06:23 PM
  4. Lines that Join w/o my permission
    By tiffany.amorgan in forum Revit Structure - General
    Replies: 4
    Last Post: 2006-10-26, 12:14 PM
  5. Join Lines
    By nsinha73 in forum Revit Architecture - General
    Replies: 7
    Last Post: 2006-10-09, 11:35 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •