I did not know if someone already had a way to copy a block along a feature line or not? I have code that I usually use with polylines. The problem is I usually have to draw the feature line first and then redraw a polyline on top of it.
(defun c:CBFP (/ foo ss lst pt)
(defun foo (p)
(if (vl-consp p)
(or (vl-member-if
(function (lambda (a) (equal (list (car a) (cadr a)) (list (car p) (cadr p)))))
plst
)
((lambda (pnt) (foreach x lst (vla-move (vla-copy x) pt pnt)) (setq pLst (cons p pLst)))
(vlax-3d-point p)
)
)
)
)
(if (and (princ "\nSelect object(s) to copy: ")
(setq lst ((lambda (i / ss e l)
(if (setq ss (ssget "_:L"))
(while (setq e (ssname ss (setq i (1+ i))))
(setq l (cons (vlax-ename->vla-object e) l))
)
)
)
-1
)
)
(setq pt ((lambda (p) (cond (p (vlax-3d-point (trans p 1 0)))))
(getpoint "\nSpecify base point: ")
)
)
(princ "\nSelect curves to copy object(s) along: ")
(setq ss (ssget '((0 . "ARC,LINE,*POLYLINE,SPLINE"))))
)
((lambda (i / e eLst p pLst)
(while (setq e (ssname ss (setq i (1+ i))))
(cond
((vl-position (cdr (assoc 0 (setq eLst (entget e)))) '("ARC" "LINE" "SPLINE"))
(mapcar (function foo) (list (vlax-curve-getStartPoint e) (vlax-curve-getEndPoint e)))
)
((vl-position (cdr (assoc 0 eLst)) '("LWPOLYLINE" "POLYLINE"))
(repeat (setq p (1+ (fix (vlax-curve-getEndParam e))))
(foo (vlax-curve-getPointAtParam e (setq p (1- p))))
)
)
)
)
)
-1
)
)
(princ)
)