Jump to content

Convert 3D Polyline to 2D Polyline


Recommended Posts

Although flatten will change all of the vertices of a 3D polyline to 0.0, the entity will technically remain a "3D polyline" (the bitcode 8 is still set on group code 70).

 

So you'll have a "2D" polyline as far as the "Z" coordinates all being 0.0, but if a application is testing this entity for a 3D polyline, that will still be true.

Link to comment
Share on other sites

EXPLODE -> PEDIT>JOIN ?

 

If you wanna go the less fancy route without those new-finagled apps and stuff. Now, gerroff mah lawn!

Link to comment
Share on other sites

  • 5 years later...

Select the 3D Poly,

then do

Modify -> Explode

then

select all the lines

then (in the properties window)

set "Start Z" to 0.00 (that is zero)

also

set "End Z" to 0.00

finally

select all the lines

then do

Modify -> Join

  • Thanks 1
Link to comment
Share on other sites

  • 4 months later...

Thank you  . i try it it working fine

On 9/26/2020 at 8:38 PM, Takis Tsiberis said:

Select the 3D Poly,

then do

Modify -> Explode

then

select all the lines

then (in the properties window)

set "Start Z" to 0.00 (that is zero)

also

set "End Z" to 0.00

finally

select all the lines

then do

Modify -> Join

 

Link to comment
Share on other sites

  • CADTutor changed the title to Convert 3D Polyline to 2D Polyline

@BIGAL  per AutoCAD help "A 3D polyline is a connected sequence of straight line segments created as a single object. 3D polylines can be non-coplanar; however, they cannot include arc segments."  No arcs,

 

Explode,flatten join.

or

with osnap set to end   you can use pline and pick the 3dpoly vertices in order.  Vertices of the 3dpoly that you pick will be projected to a 2D plane that is parallel to the current xy plane and that contains the first vertex you digitize. 

 

Link to comment
Share on other sites

Something i extract from one code.

command is 3dpto2d

Work only for Plines without ARCs :)

(defun LM:group-n ( l n / r )
    (if l
        (cons
            (reverse (repeat n (setq r (cons (car l) r) l (cdr l)) r))
            (LM:group-n l n)
        )
    )
)

(defun c:3dpto2d (/ listt XY)
(setq sel (ssget '((0 . "POLYLINE"))))

(repeat (setq i (sslength sel))
	(setq Vname (vlax-ename->vla-object (ssname sel (setq i (1- i)))))
	(if (equal (vlax-get Vname 'ObjectName) "AcDb3dPolyline")
		(progn
			(setq coord (vlax-get Vname 'coordinates))
			(setq listt (LM:group-n coord 3))
				(foreach x listt (setq XY (cons (list (car x) (cadr x)) XY)))
					(ENTMAKE
						(APPLY
						(FUNCTION APPEND)
						(CONS (LIST '(0 . "LWPOLYLINE")
									'(100 . "AcDbEntity")
									'(67 . 0)
									'(410 . "Model")
									(cons 8 (getvar 'clayer))
									'(100 . "AcDbPolyline")
									(CONS 90 (LENGTH XY))
									(if (= (vlax-get Vname 'Closed) 0) (cons 70 0) (cons 70 1))
								)
								(MAPCAR (FUNCTION LIST)
										(MAPCAR (FUNCTION (LAMBDA (XY) (CONS 10 XY))) XY)                     
								)
						)
						)
					)
			(setq XY nil)
		)
	)
)
(princ)
)

 

  • Like 1
Link to comment
Share on other sites

  • 2 years later...
On 2/22/2021 at 3:09 PM, Trudy said:

Work only for Plines without ARCs :)

Thanks its realy worked

Edited by Hanter Thomsom
Link to comment
Share on other sites

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