Jump to content

Recommended Posts

Posted

Hi all, was just wondering how to convert a bunch of lines into one continuous polyline?

Posted

Check the help files on how to use the "pedit" command. It will convert a line into a polyline, and then you can join other segments, edit the width, etc.

Posted

PEDIT and use the Multiple option or there is MPEDIT in the Express Tools.

Posted

There's also a Join command.

Posted
There's also a Join command.

 

Join will take line segments that are collinear and turn them into one selectable object but it doesn't turn lines into polylines. Arcs have to lie on the same imaginary circle, and it won't join a line to an arc.

Posted
... Arcs have to lie on the same imaginary circle' date=' and it won't join a line to an arc.[/quote']

 

FWIW: 2012 will join an arc to a line, creating a pline in the process.

Posted
FWIW: 2012 will join an arc to a line, creating a pline in the process.

 

The join option of Pedit does this, but i'd have to look into the future for your version. I'm stuck in 2010! :D

Posted

There are two ways to do this:

 

1- I always find this procedure the easiest: use MPEDIT, select the lines, convert to polylines (YES), select JOIN and when it ask you to enter a fuzz distance just press ENTER and then press ESC to complete the process.

 

2- If you have an enclosed area that consist of lines, use the BOUNDARY (BO) command to convert those lines into polylines.

Posted

So I type in MPEDIT in the command line and I select the lines, what do I do after that? It keeps asking me all these different questions.

Posted
So I type in MPEDIT in the command line and I select the lines, what do I do after that? It keeps asking me all these different questions.

 

You answer Yes, enter, enter. Done.

Posted

PEDIT is clunky .... PolyJoin is sleek

 

;;---------------------=={ Polyline Join }==------------------;;
;;                                                            ;;
;;  Attempts to join all Lines, Arcs and LWPolylines in a     ;;
;;  selection.                                                ;;
;;------------------------------------------------------------;;
;;  Author: Lee Mac, Copyright © 2011 - www.lee-mac.com       ;;
;;------------------------------------------------------------;;

(defun c:pj nil (c:PolyJoin))

(defun c:PolyJoin ( / *error* _StartUndo _EndUndo vl ov ss )
 (vl-load-com)
 ;; © Lee Mac 2011

 (defun *error* ( msg )
   (if ov  (mapcar 'setvar vl ov))
   (if doc (_EndUndo doc))
   (or (wcmatch (strcase msg) "*BREAK,*CANCEL*,*EXIT*")
       (princ (strcat "\n** Error: " msg " **"))
   )
   (princ)
 )

 (defun _StartUndo ( doc ) (_EndUndo doc)
   (vla-StartUndoMark doc)
 )

 (defun _EndUndo ( doc )
   (if (= 8 (logand 8 (getvar 'UNDOCTL)))
     (vla-EndUndoMark doc)
   )
 )

 (setq doc (vla-get-ActiveDocument (vlax-get-acad-object)))
 (_StartUndo doc)
 
 (setq vl '("CMDECHO" "PEDITACCEPT") ov (mapcar 'getvar vl))
 (mapcar 'setvar vl '(0 1))

 (if (setq ss (ssget "_:L" '((0 . "LINE,ARC,LWPOLYLINE"))))
   (command "_.pedit" "_M" ss "" "_J" "" "")
 )

 (mapcar 'setvar vl ov)
 (_EndUndo doc)
 (princ)
)

Posted

Typical autocad, theres usually more than one way to do something. The PE - JOIN process works as long as the lines you are joining together have the same beginning and end point, like if you were to draw several lines continouly. You can also connect multiple lines together that do not have the same beginning and end points connected by converting one line into a PLINE and using the FILLET - MULTIPLE command, select each end of two lines you want to join together, this will create the connected lines into a PLINE as long as the first one you select is a PLINE. You can also set a radius to the fillet, which is handy when you need to create a known radius that is tangent to two lines, like at road intersections.

Posted (edited)
....

You can also connect multiple lines together that do not have the same beginning and end points connected by converting one line into a PLINE and using the FILLET - MULTIPLE command, select each end of two lines you want to join together, this will create the connected lines into a PLINE as long as the first one you select is a PLINE. ...

 

This is no longer true, you don't need to convert a line to pline first, and you don't have to use fillet. If you have two lines say at 90 degrees to one another and not touching by 6 inches, start PE, Mulitple, pick, join, fuzzfactor >6, finished. They are now one pline.

Edited by rkent
clarified fuzzfactor value
Posted
This is no longer true, you don't need to convert a line to pline first, and you don't have to use fillet. If you have two lines say at 90 degrees to one another and not touching by 6 inches, start PE, Mulitple, pick, join, fuzzfactor or 8, finished. They are now one pline.

 

Cool, thats going to be especially helpful when the lines have different elevations.

Posted
Cool, thats going to be especially helpful when the lines have different elevations.

 

I don't think so.... you can't join line segments that can't define a single plane.

Posted
You answer Yes, enter, enter. Done.

 

Simple and Quick. I LIKE IT! Thanks!

Posted
Simple and Quick. I LIKE IT! Thanks!

 

8)8)8)8)8)

  • 2 years later...
  • 2 years later...
Posted
Check the help files on how to use the "pedit" command. It will convert a line into a polyline' date=' and then you can join other segments, edit the width, etc.[/quote']

 

just what the dr ordered :)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...