试试这个:
- (defun c:AveMid ( / ss )
- ;; © Lee Mac ~ 24.05.10
- (vl-load-com)
-
- (if (setq ss (ssget '((0 . "ARC,*POLYLINE,LINE"))))
- (
- (lambda ( i / ent mLst l )
- (while (setq ent (ssname ss (setq i (1+ i))))
- (setq mLst
- (cons
- (vlax-curve-getPointatParam ent
- (/ (+ (vlax-curve-getEndParam ent)
- (vlax-curve-getStartParam ent)) 2.)
- )
- mLst
- )
- )
- )
- (setq l (length mLst))
- (
- (lambda ( p )
- (entmakex
- (list
- (cons 0 "POINT")
- (cons 10 p)
- )
- )
- )
- (mapcar (function /)
- (apply (function mapcar)
- (cons
- (function +) mLst
- )
- )
- (list l l l)
- )
- )
- )
- -1
- )
- )
- (princ)
- )
|