;3D Utility EB ;Convert 3d polyline to 2d polyline ;.............................................................................. (defun c:p3p2 (/ eg cl en e nc fp pt) (princ "\n[Change 3D Polyline to 2D Polyline.]") (setq e (entsel " Select a 3DPoly: ") ; get the header data en (car e) cl (if(=(cdr(assoc 70(entget en)))1)1) ; closed flag 1=yes p1 (cdr(assoc 10(entget(entnext en)))) p2 (cdr(assoc 10(entget(entnext(entnext en))))) ) (command "ucs" "3" p1 p2 "") (setq fp (trans p1 0 1)) ; save first point ; en (entnext en)) ; leave header (setvar "blipmode" 0) (command "pline") (command fp) ; id first vertex (while (/=(cdr(assoc 0(setq eg(entget(setq en(entnext en))))))"SEQEND") (setq pt (trans(cdr(assoc 10 eg))0 1)) (if pt (command pt)) (if (and (not pt) cl)(command fp)) );endwhile (command "") (command "ucs" "w") (setvar "blipmode" 1) (princ) );end C:P3P2