TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: Peter2 on February 04, 2020, 06:20:30 AM
-
I know some lists for creating vertexlists and I know some "bulge-feature", but does someone know a routine which creates a list of vertex incl. the mids of bulges?
Thanks for hints!
-
Simple solution that makes use of vlax-curve-getpointatparam. Points in WCS.
; (ListPolyPoints (vlax-ename->vla-object (car (entsel))))
(defun ListPolyPoints (obj / endParam param ret)
(setq param 0)
(setq endParam (vlax-curve-getendparam obj))
(repeat (+ (fix endParam) (if (= :vlax-true (vla-get-closed obj)) 0 1))
(setq ret (cons (vlax-curve-getpointatparam obj param) ret))
(if (and (< param endParam) (/= 0 (vla-getbulge obj param)))
(setq ret (cons (vlax-curve-getpointatparam obj (+ 0.5 param)) ret))
)
(setq param (1+ param))
)
(reverse ret)
)
-
Great. Thanks!
-
Here's another possible method using Vanilla AutoLISP:
(defun lwverticesmidpoints
( enx
/ vt1 vt2
) )
)
(lwverticesmidpoints
(member vt2 enx
)) )
)
)
)
To test:
EDIT: To account for closed polylines:
(defun lwverticesmidpoints
( enx
/ vt1 vt2
) )
)
)
(lwverticesmidpoints
(member vt2 enx
)) )
)
)
)