Originally Posted by
Lions60
Here is just a real simple code to change all your 3d polylines into 2d Polylines. If your prefer you can get rid of the alert. It is just there to let you know what the program is doing.
Lions60, this will not work. See comments below.
Code:
(defun 3dp () ;Missing the "C:".
Yes, it will still run as (3dp), but many people won't know this.
(alert "Converting 3dPolyLines to 2DPolyLines")
(setq ss (ssget "X" '((0 . "POLYLINE")))) ;This selects all POLYLINE entities, not just 3D.
(command "explode" ss) ;This will not work. You would have to walk the selection set
and explode each one.
(setq ss (ssget "X" '((0 . "LINE"))))
(command "pedit" ss "y" "j"ss"""") ;This will fail also, because the
resulting LINE entities are still 3D.
You also fail to account for the setting of PEDITACCEPT.
Lastly, you would need the "_M" (multiple option) in there.
)
A better lisp solution would be to walk each 3D Polyline entity, scoop up the coordinates, erase it, then remake a 2D polyline in its place at the desired elevation.