If the coordinate system not the world to create a polyline, other program is necessary!
;Change a coordinate system with world(global) on another
(While (setq pt (getpoint))
(setq lst (cons pt lst))
) ;_ While
(setq lst (reverse lst))
;Creation of the polyline
(entmakex
(apply 'append
(list
(list
'(0 . "LWPOLYLINE")
'(100 . "AcDbEntity")
'(62 . 1)
'(100 . "AcDbPolyline")
(cons 90 (length lst))
(cons 38 (caddr (trans '(0 0 0) 1 (trans '(0. 0. 1.) 1 0))))
'(70 . 1)
) ;_ list
(mapcar '(lambda (x) (list 10 (car x) (cadr x)))
(mapcar '(lambda (x) (trans x 1 (trans '(0. 0. 1.) 1 0))) lst)
) ;_ mapcar
(list (cons 210 (trans '(0. 0. 1.) 1 0)))
) ;_ list
) ;_ apply
) ;_ setq
To create a projection all polylines to a plane 0,0,1 in a world(global) coordinate system:
(defun c:lw-osc-usc (/ LST N SSET X X1)
(if (setq SSET (ssget "_X" '((0 . "LWPOLYLINE"))))
(foreach x (mapcar
(function vlax-ename->vla-object)
(vl-remove-if
(function listp)
(mapcar (function cadr) (ssnamex sset))
) ;_ vl-remove-if
) ;_ mapcar
(setq
n (vlax-safearray->list
(vlax-variant-value (vla-get-normal x))
) ;_ vlax-safearray->list
e (vla-get-elevation x)
lst (apply 'append
(mapcar '(lambda (x)
((lambda (x1) (list (car x1) (cadr x1)))
(trans (list (car x)(cadr x)e) 0 (trans '(0. 0. 1.) n 0))
)
) ;_ lambda
(2d-lw-pt (vlax-safearray->list
(vlax-variant-value (vla-get-coordinates x))
) ;_ vlax-safearray->list
)
) ;_ mapcar
) ;_ apply
) ;_ setq
(vla-put-Coordinates
x
(vlax-safearray-fill
(vlax-make-safearray vlax-vbDouble
(cons 0 (1- (length lst)))
) ;_ vlax-make-safearray
lst
) ;_ vlax-safearray-fill
) ;_ vla-put-Coordinates
(vla-put-elevation x 0.)
(vla-put-normal x (vlax-3d-point 0. 0. 1.))
(vla-update x)
) ;_ foreach
) ;_ if
) ;_ defun
(defun 2d-lw-pt (lst)
(if lst
(cons (list (car lst) (cadr lst)) (2d-lw-pt (cddr lst)))
) ;_ if
)
(c:lw-osc-usc)
Good luck