版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。
版权
展开全部
程序是e68a843231313335323631343130323136353331333335336465没有错的。不过你可能是选择的有问题。
;我修改了一下
;----------------------------------------------------------------------
(defun c:gw ()
(setq olddz (getvar "dimzin"))
(setvar "dimzin" 0)
(setvar "blipmode" 0)
(prompt "选取钢筋直径:")
(setq a (ssget))
(setq ename (ssname a 0))
(setq a1 (entget ename))
(setq aa (cdr (assoc 1 a1)))
(setq a (atof aa))
(prompt "选取根数:")
(setq b (ssget))
(setq ename (ssname b 0))
(setq b1 (entget ename))
(setq bb (cdr (assoc 1 b1)))
(setq b (atof bb))
(prompt "选取单长:")
(setq c (ssget))
(setq ename (ssname c 0))
(setq c1 (entget ename))
(setq cc (cdr (assoc 1 c1)))
(setq c (atof cc))
(setq d (* b c 0.001))
(setq e (rtos (* 0.006165375 a a) 2 3))
(setq e (atof e))
(setq f (* e d))
(setvar "dimzin" 8)
(setq d (rtos d))
(prompt "选取修改总长:")
(setq x (ssget))
(setq x (ssname x 0))
(setq x1 (entget x))
(setq x1 (subst (cons 1 d) (assoc 1 x1) x1))
(entmod x1)
(setvar "dimzin" 8)
(setq f (rtos f 2 3))
(prompt "选取修改总重:")
(setq x (ssget))
(setq x (ssname x 0))
(setq x1 (entget x))
(setq x1 (subst (cons 1 f) (assoc 1 x1) x1))
(entmod x1)
(setvar "dimzin" olddz)
(princ)