- (defun C:TT (/ LST BLK)
- (vl-load-com)
- ;;建构表
- (setq LST '((1 0.365)
- (2 0.385)
- (3 0.545)
- (4 0.665)
- (5 0.755)
- (6 0.805)
- )
- )
- ;;选图块
- (setq BLK (vlax-ename->vla-object (car (entsel))))
- ;;填入值
- (MAT_ATT BLK LST)
- )(defun MAT_ATT (OBJ LST / ATT X)
- (mapcar
- '(lambda (ATT X)
- (vla-put-textstring ATT (rtos (nth 1 (nth X LST))))
- )
- (vlax-invoke OBJ 'GETATTRIBUTES)
- '(2 4 5 3 1 0)
- )
- )
|