本帖最后由 自贡黄明儒 于 2013-7-30 17:08 编辑
- (defun c:w1 (/ E N OBJ SS WIDTH WIDTHLIST)
- ;; 指定线宽长度
- (defun getMyss (ss0 WIDTH / E LENT N OBJ SSCIR)
- (command "_.select" ss0 "")
- (setq ssCIR (ssget "_p" (list (CONS 370 WIDTH))))
- (setq LENT 0)
- (IF ssCIR
- (REpeat (setq n (sslength ssCIR))
- (setq e (ssname ssCIR (setq n (1- n))))
- (setq obj (vlax-ename->vla-object e))
- (SETQ LENT (+ (VLAX-GET obj 'length) LENT))
- )
- )
- (princ "\n")
- (princ WIDTH)
- (princ ":")
- (princ LENT)
- )
- (setq ss (ssget (list (cons 0 "ARC,*LINE,CIRCLE"))))
- (repeat (setq n (sslength ss))
- (setq e (ssname ss (setq n (1- n))))
- (setq obj (vlax-ename->vla-object e))
- (SETQ WIDTH (VLAX-GET obj 'lineweight))
- (if (member WIDTH WIDTHlist)
- nil
- (progn (setq WIDTHlist (cons WIDTH WIDTHlist))
- (getMyss ss WIDTH)
- )
- )
- )
- (princ)
- )
|