Try this.
;; Argument: a flat 3D coordinate list.
;; (setq l '(414.576 572.128 0.0 494.558 637.135 20.0 562.58 575.117 30.0))
;; Returns:
;; (414.576 572.128 0.0 494.558 637.135 0.0 562.58 575.117 0.0)
(defun ZZeroCoord (coord / lst)
(repeat (/ (length coord) 3)
(setq lst (cons (car coord) lst)
lst (cons (cadr coord) lst)
lst (cons 0.0 lst)
coord (cdddr coord)
)
)
(reverse lst)
) ;end
;; Flatten a spline to Z elevation zero in WCS.
;; Note, fit points may be lost, but that can happen during
;; spline edit operations anyway. The spline should not change
;; shape when the view is parallel to WCS.
(defun c:2DSpline ( / obj ctrlpts testpts kts)
(if
(and
(setq obj (car (entsel "\nSelect spline: ")))
(setq obj (vlax-ename->vla-object obj))
(eq "AcDbSpline" (vlax-get obj 'ObjectName))
)
(progn
(setq ctrlpts (vlax-get obj 'ControlPoints)
testpts (ZZeroCoord ctrlpts)
)
(if
(or
(eq acFalse (vlax-get obj 'IsPlanar))
(not (equal ctrlpts testpts 1e-8))
)
(progn
(setq kts (vlax-get obj 'Knots))
(vlax-put obj 'ControlPoints testpts)
(vlax-put obj 'Knots kts)
(princ "\nSpline was modified. ")
)
(princ "\nSpline was not modified. ")
)
)
)
(princ)
) ;end