这完全是垃圾,但在回家之前我有几分钟要消磨,我很无聊。。。。
- (defun c:DAC (/ ss point curve num dist lgth)
- (and
- (princ "\nSelect object(s) to divide along curve: ")
- (setq ss (ssget ":L"))
- (setq point (getpoint "\nBase point for objects: "))
- (setq curve (car (entsel "\nSelect curve to divide: ")))
- (wcmatch (cdr (assoc 0 (entget curve))) "LINE,LWPOLYLINE,ARC")
- (setq num (getint "\nNumber of objects: "))
- (setq num (1+ num))
- (setq dist 0.0)
- (or (not (vl-catch-all-error-p (setq lgth (vl-catch-all-apply 'vla-get-length (list (vlax-ename->vla-object curve))))))
- (not (vl-catch-all-error-p (setq lgth (vl-catch-all-apply 'vla-get-arclength (list (vlax-ename->vla-object curve))))))
- )
- ;(setq lgth (vla-get-length (vlax-ename->vla-object curve)))
- (while (< dist (- lgth (/ lgth num)))
- (vl-cmdf "_.copy" ss "" point (vlax-curve-getpointatdist curve (setq dist (+ dist (/ lgth num)))))
- ) ;_ while
- ) ;_ and
- (princ)
- ) ;_ defun
|