Jump to content
how do i do this?

Convert Lines to Polylines

Recommended Posts

how do i do this?

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

Share this post


Link to post
Share on other sites
Jack_O'neill

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.

Share this post


Link to post
Share on other sites
SLW210

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

Share this post


Link to post
Share on other sites
CyberAngel

There's also a Join command.

Share this post


Link to post
Share on other sites
Jack_O'neill
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.

Share this post


Link to post
Share on other sites
rkent
... 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.

Share this post


Link to post
Share on other sites
Jack_O'neill
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

Share this post


Link to post
Share on other sites
yekom

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.

Share this post


Link to post
Share on other sites
Joseph Marquez

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.

Share this post


Link to post
Share on other sites
rkent
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.

Share this post


Link to post
Share on other sites
nestly

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)
)

Share this post


Link to post
Share on other sites
clepine

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.

Share this post


Link to post
Share on other sites
rkent
....

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

Share this post


Link to post
Share on other sites
clepine
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.

Share this post


Link to post
Share on other sites
nestly
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.

Share this post


Link to post
Share on other sites
Joseph Marquez
You answer Yes, enter, enter. Done.

 

Simple and Quick. I LIKE IT! Thanks!

Share this post


Link to post
Share on other sites
SLW210
Simple and Quick. I LIKE IT! Thanks!

 

8)8)8)8)8)

Share this post


Link to post
Share on other sites
chipopeloto

This is what I was looking for thanks!

Share this post


Link to post
Share on other sites
TheCADnoob
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 :)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×