 - (defun c:tt ()
- (setq dn (vl-filename-base (getvar "dwgname")))
- (if (setq nn (vl-string-search " " dn))
- (progn
- (setq aa (substr dn 1 nn))
- (setq bb (substr dn (+ nn 2)))
- (setq ss (ssget "x" '((0 . "INSERT") (66 . 1))))
- (repeat (setq n (sslength ss))
- (setq s1 (ssname ss (setq n (1- n))))
- (foreach a (reverse (xyp-Att2list s1))
- (setq ts (cadr a)
- b (car a)
- )
- (cond ((= ts "客户图号") (xyp-SubUpd b 1 aa))
- ((= ts "零件名称") (xyp-SubUpd b 1 bb))
- ((= ts "设计日期") (xyp-SubUpd b 1 (menucmd "m=$(edtime,$(getvar,DATE),yyyy-mo-dd)")))
- ((= ts "产品编码") (setq e1 (last a)))
- ((= ts "客户") (xyp-SubUpd b 1 (substr E1 2 3)))
- )
- )
- )
- )
- )
- (princ)
- )
|