发布于:2010-10-21 20:47:21
来自:建筑设计/CAD下载及教程
[复制转发]
;自身乘一个倍数
(DEFUN C:zc1()
(setvar "cmdecho" 0)
(PRINT "(Copyright- aningtang)")
(SETQ s0 (GETREAL "请输入乘数:"))
(PRINT "PLEASE SELECT THE object")
(SETQ S (SSGET ))
(SETQ N (SSLENGTH S))
(SETQ M 0)
(REPEAT N
(SETQ SN (SSNAME S M))
(SETQ e (ENTGET SN))
(IF (= (cdr (assoc 0 e)) "TEXT")
(PROGN
(setq oldr (assoc 1 e))
(setq old0 (cdr oldr))
(setq newr (rtos (* (atof old0) s0) 2 1))
(setq e1 (subst (cons (car (assoc 1 e)) newr) (assoc 1 e) e))
(entmod e1)
)
)
(SETQ M (+ M 1))
)
)
;自身除一个倍数
(DEFUN C:zc2()
(setvar "cmdecho" 0)
(PRINT "(Copyright- aningtang)")
(SETQ s0 (GETREAL "请输入被除数:"))
(PRINT "PLEASE SELECT THE object")
(SETQ S (SSGET ))
(SETQ N (SSLENGTH S))
(SETQ M 0)
(REPEAT N
(SETQ SN (SSNAME S M))
(SETQ e (ENTGET SN))
(IF (= (cdr (assoc 0 e)) "TEXT")
(PROGN
(setq oldr (assoc 1 e))
(setq old0 (cdr oldr))
(setq newr (rtos (/ (atof old0) s0) 2 1))
(setq e1 (subst (cons (car (assoc 1 e)) newr) (assoc 1 e) e))
(entmod e1)
)
)
(SETQ M (+ M 1))
)
)
;自身加一个数
(DEFUN C:zj1()
(setvar "cmdecho" 0)
(PRINT "(Copyright- aningtang)")
(SETQ s0 (GETREAL "请输入增加的数值:"))
(PRINT "PLEASE SELECT THE object")
(SETQ S (SSGET ))
(SETQ N (SSLENGTH S))
(SETQ M 0)
(REPEAT N
(SETQ SN (SSNAME S M))
(SETQ e (ENTGET SN))
(IF (= (cdr (assoc 0 e)) "TEXT")
(PROGN
(setq oldr (assoc 1 e))
(setq old0 (cdr oldr))
(setq newr (rtos (+ (atof old0) s0) 2 1))
(setq e1 (subst (cons (car (assoc 1 e)) newr) (assoc 1 e) e))
(entmod e1)
)
)
(SETQ M (+ M 1))
)
)
;自身减一个数
(DEFUN C:zj2()
(setvar "cmdecho" 0)
(PRINT "(Copyright- aningtang)")
(SETQ s0 (GETREAL "请输入减少的数值:"))
(PRINT "PLEASE SELECT THE object")
(SETQ S (SSGET ))
(SETQ N (SSLENGTH S))
(SETQ M 0)
(REPEAT N
(SETQ SN (SSNAME S M))
(SETQ e (ENTGET SN))
(IF (= (cdr (assoc 0 e)) "TEXT")
(PROGN
(setq oldr (assoc 1 e))
(setq old0 (cdr oldr))
(setq newr (rtos (- (atof old0) s0) 2 1))
(setq e1 (subst (cons (car (assoc 1 e)) newr) (assoc 1 e) e))
(entmod e1)
)
)
(SETQ M (+ M 1))
)
)
[
本帖最后由 erjijiegou2 于 2010-10-21 22:00 编辑 ]
申明:内容来自用户上传,著作权归原作者所有,如涉及侵权问题,请点击此处联系,我们将及时处理!
全部回复(55 )
只看楼主 我来说两句回复 举报
回复 举报