可能是这样的:
- (defun c:tLen nil
- ;; © Lee Mac 2010
- (
- (lambda ( SelSet Total i / entity )
- (if SelSet
- (princ
- (strcat "\nTotal Length: "
- (rtos
- (while (setq entity (ssname SelSet (setq i (1+ i))))
- (setq Total
- (+
- (vlax-curve-getDistAtParam entity
- (vlax-curve-getEndParam entity)
- )
- Total
- )
- )
- )
- )
- )
- )
- )
- )
- (ssget
- (list (cons 0 "ARC,CIRCLE,ELLIPSE,LINE,*POLYLINE,SPLINE")
- (cons -4 "<NOT")
- (cons -4 "<AND")
- (cons 0 "POLYLINE")
- (cons -4 "<OR")
- (cons -4 "&=") (cons 70 16)
- (cons -4 "&=") (cons 70 64)
- (cons -4 "OR>")
- (cons -4 "AND>")
- (cons -4 "NOT>")
- )
- )
- 0 -1
- )
- (princ)
- )
|