Community
AutoCAD Forum
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

CONVERT 2D POLYLINE TO POLYLINE

19 REPLIES 19
SOLVED
Reply
Message 1 of 20
mlang
81693 Views, 19 Replies

CONVERT 2D POLYLINE TO POLYLINE

Hello All,

 

Bit of a head stumper here for me.  I have a simple consultant drawing (attached) which contains a small sample of contour lines made from 2D polylines.  I would like to convert these to regular polylines without losing the elevation.  I have used the CONVERT and CONVERTPOLY commands to no avail.  Has anyone encountered this before??  Can anyone offer some suggestions to how I can convert these 2D polylines without losing the elevation property?

 

I can always explode the lines and rejoin them but that will brake up the pline into hundreds of segments (which I don't want).  The line segments would become so small that the ltscale would have no affect as I need to see the lines and dashes.

 

PLINETYPE is set to 2 already.

 

If you spline fit a polyline it turns it into a 2d polyline so I'm not sure if this method was used for the contour lines.  BTW... does anyone know why or when a 2d polyline would be used.  To me they are just the same thing but with different context menus.

 

Any help would be appreciated!

19 REPLIES 19
Message 2 of 20
bluebrad60
in reply to: mlang

Pedit....Decurve...will change your 2dpolyline to a pline

Message 3 of 20
mlang
in reply to: bluebrad60

Hi thanks for your reply.  I should have added more detail.  I tried the decurve already and yes it does convert it to a polyline.  However it 'decurves' the original shape of the contour line and makes it sharp and jagged.  I want to retain the original curvature of the contour line as this is an important design aspect.

 

Thanks for your suggestion..

Message 4 of 20
bluebrad60
in reply to: mlang

This may not be the solution you want, but if there are not a lot of contours this seemed to work.

 

explode the 3dpolyline.....pedit...yes...join...p (for previous)

 

then enable linetype generation. repeat as required.

 

It's kind of onerous...but achieves your end product.

 

Sorry but it's all i got. Good luck.

Message 5 of 20
HullDrafter
in reply to: mlang

I may have done this wrong, but I made sure my peditaccept was set for 1, entered pedit, selected your top line, which offered to let me close the spline.

It then became a closed spline.

Is this what you were looking for. It didn't look like it changed the curves, it just became a closed spline. The elevations stayed the same.

Hope this helps.

Message 6 of 20
nestly2
in reply to: mlang

Going just from memory, 2D Polylines are also known as "Heavy" polylines.  I believe each vertex is recorded as an x,y,z value, whereas LW Polylines (Polylines)  only record the x & y values of the individual vertices, and Z is recorded only once for the polyline object.

 

I was not able to "convert" your 2D Polylines either, but was successful in Xploding them and then putting them back together in one operation using LeeMac's Polyjoin lisp.  In a busy drawing, simply select all the offending polylines using whatever method you prefer (QSelect, SelectSimilar, Layiso, etc) and ISOLATE them until you've exploded and re-joined them.

Message 7 of 20
Kent1Cooper
in reply to: mlang

Since they appear to be made from all-line-segment LWPolylines using Pedit and probably the Spline option, you can't use the handy CONVERTPOLY command on them to make them LightWeight, as you would be able to do with a Polyline originally drawn as "heavy" 2D.  But try this [a routine could easily be written to automate the process]:

 

Offset the Polyline to one side [by a small amount, so you don't adversely affect areas of tighter curvature], then back again the other way.  Eliminate the original and the intermediate offset Polylines.  It's essentially the equivalent of Exploding it and Pedit-Joining the results back together, so the final one will be lots of short line segments, which means you will be able to use CONVERTPOLY on it to make it LightWeight.  Enable linetype generation.

Kent Cooper, AIA
Message 8 of 20
mlang
in reply to: Kent1Cooper

Thanks everyone for your suggestions.  It is much appreciated!

 

From what I have gathered, all the methods involve (to a certain extent) exploding and rejoining to turning it into a regular polyline.  The downside to this is that the contours become hundreds of smaller pieces joined together.  Applying an ltscale to this will have minimal affect as the segments are so tiny that the lines and dashes of hidden lines won't show.  This is something we will have to live with as certain portions will have the hidden linetype visible.  At least this will be as close as possible to our desired end result.

 

Once again thanks for everyone's feedback!

Message 9 of 20
hgasty1001
in reply to: mlang

Hi,

 

You can use SPLINEDIT to convert that *Splines* to a polyline (Lightweight).

 

Gaston Nunez

Message 10 of 20
mlang
in reply to: hgasty1001

Hi Gaston,

 

The splinedit worked much better!  Was able to convert the contours to a polyline without making it into hundreds of tiny line segments and retaining the ltscale.  Perfect.  Got our desired result!  

 

I would never of thought about using splinedit on a polyline.

 

Hats off to you Gaston!

 

 

Message 11 of 20
hgasty1001
in reply to: mlang

Hi,

 

Glad to help. The point is that once you pedit a pline using the spline option, you end up with a... spline ( a cubic one by default), so splinedit should work.

 

Gaston Nunez

Message 12 of 20
Kent1Cooper
in reply to: mlang


@mlang wrote:

....contours become hundreds of smaller pieces joined together.  Applying an ltscale to this will have minimal affect as the segments are so tiny that the lines and dashes of hidden lines won't show.  This is something we will have to live with ....


I know you have a different solution, but to clarify what's been mentioned already in several replies about the above:  Turn on [enable] linetype generation for the resulting Polylines [in the Properties box is the easiest way, and you could do it for a whole selection's worth at once], and that won't be a problem -- non-continuous linetypes will "flow" across/around vertices, and won't be impaired by the lengths of the segments.

Kent Cooper, AIA
Message 13 of 20
mlang
in reply to: Kent1Cooper

Hi Kent,

 

Enabling linetype generation resolves the ltscale issue.  Considering the sheer number of contour lines in my full drawing, this solution may be more practical as you can apply it to a whole selection.

 

Much appreciated for your input.  Thanks Kent!

Message 14 of 20
BrightLamp
in reply to: mlang

Another solution:

Just use the CONVERT command.

---

Command: CONVERT

Enter type of objects to convert [Hatch/Polyline/All] <All>: p
Enter object selection preference [Select/All] <All>: s

Message 15 of 20
JeffClark433
in reply to: mlang

I've attached a little lisp routine I wrote quite a few years ago that turns on LTGEN for ALL Polylines and LWPolylines in your drawing. It's very basic and simple but I have found it very usefull over the years.

Once you load it just type LTGEN and - poof! All ltgen's are on.

It might help you out some time.

Message 16 of 20
dmpe
in reply to: mlang

This worked for me: Isolate Object (the 2d polyline), then do BOUNDARY and click the interior.  It creates a regular polyline that looks just like the 2d polyline.

Message 17 of 20
mlewisWXP6X
in reply to: BrightLamp

Thanks. 

The "CONVERT" command ended up being the solution for me.

Message 18 of 20
ravindersingh041989
in reply to: mlang

Dear all

No need for a LISP to Convert 2d polyline to polyline.

Just make a block (WBLOCK) off all the 2d polylines and save it as"autocad release 13 ASCII DXF" or "12,11,10,9.ASCII DXF". 

Done

Message 19 of 20
andresjustiniano
in reply to: mlang

"Si seleccionas la 2d Polyline, aplicando el comando Join tambien se convierte en polyline" 

 

If you select the 2d Polyline, applying the Join command also becomes a Polyline

ING. Hugo Andrés Justiniano Rojas
Message 20 of 20
7aizur
in reply to: JeffClark433

Thanks for the lisp, it's really amazing

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost