Lions60, this will not work. See comments below.
Originally Posted by Lions60
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.
(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.