本帖最后由 bingshuier 于 2014-10-14 00:38 编辑
 - (defun c:xx()
- (setq ss (ssget))
- (setq i 0)
- (repeat (sslength ss)
- (setq aa (nth i ss))
- (setq sc (strlen aa))
- (if (= sc 8)
- (setq q2 (substr aa 1 2))
- (setq q3 (substr aa 5 3))
- (setq new (strcat q2 "0" "x" q2 "0"))
- (func1)
- )
- (if (= sc 7)
- (setq q2 (substr aa 1 2))
- (setq q3 (substr aa 5 2))
- (setq new (strcat q2 "0" "x" q2 "0"))
- (func1)
- )
- (setq i (1+ i))
- )
- )
- (defun func1()
- (setq ent_list (entget aa))
- (setq ent_1_old (assoc 1 ent_list))
- (setq ent_1_new (cons 1 new))
- (SETQ ent_list (subst ent_1_new ent_1_old ent_list))
- (entmod ent_list)
- )
- ;;;先是把第三个数字弄为0,在把最后一个弄成(因为有500x1000和500x00两种情况,所以第
- 三个是确定的但是最后一个的是第几个不确定)
|