Ok, grazie.
one more thing that i forgot to mention was that your
(setq PntLst (mapcar 'cdr (vl-remove-if-not (function (lambda (x) (eq 10 (car x)))) (entget ent))))
and ymg's
(setq i (+ (vlax-curve-getEndParam en) 1))
(while (setq v (vlax-curve-getPointAtParam en (setq i (1- i))))
(setq l (cons v l))
)
return different results
so be careful
Sorry for late, now I realized:
Case X > if the LW is closed (flag 70 = 1) > return also the last vertex (as in Poly "C")
Case Y > if the LW is closed (flag 70 = 1) > do NOT return the last vertex
(defun Ale_AddZeta (pt)
(if (not (caddr pt))
(list (car pt) (cadr pt) 0.0)
pt
)
)
(defun c:test2 (/ ent pt PntLst i v l)
(setq ent (car (entsel "\nLWPolyline: ")))
(setq PntLst (mapcar 'cdr (vl-remove-if-not (function (lambda (x) (eq 10 (car x)))) (entget ent))))
(setq PntLst (mapcar 'Ale_AddZeta PntLst))
(setq i (+ (vlax-curve-getEndParam ent) 1))
(while (setq v (vlax-curve-getPointAtParam ent (setq i (1- i))))
(setq l (cons v l))
)(princ " \n ")
(princ (vl-princ-to-string l)) ; case X
(princ " \n ") (princ (vl-princ-to-string PntLst)) ; case Y
(princ)
)
Just a note: in case "C" (open but apparently closed ) with:
(vk_IsPointInside
pt
(if (vl-position (cons 70 1) (entget ent))
(cons (last PntLst) PntLst)
PntLst
)
)
you add a double vertex equal to the last...