(defun c:cbp (/ s sn l i d lst p a b j k)
;; Tharwat 19.12. 2015 ;;
(princ "\nPick a LWpolyline ...")
(if (setq s (ssget "_+.:S:E" '((0 . "LWPOLYLINE"))))
(progn (setq l (vlax-curve-getdistatparam
(setq sn (ssname s 0))
(fix (vlax-curve-getendparam sn))
)
i (/ l 1000.)
d i
)
(repeat 1000
(setq lst (cons (vlax-curve-getpointatdist sn i) lst)
i (+ i d)
)
)
(vla-getboundingbox (vlax-ename->vla-object sn) 'j 'k)
(if (and j k)
(progn
(vla-ZoomWindow
(vlax-get-acad-object)
j
k
)
(sssetfirst nil (ssget "_CP" lst '((0 . "INSERT"))))
)
)
)
)
(princ)
)(vl-load-com)
(c:cbp)

Advertisements