feng8511 发表于 2012-3-26 12:43:01

求助

(defun C:XX (/ a b xs d dist jk xjj obj1 pt1 aaa)
(setq a “0”)
(setq b 1)
(setq dist (getdist “测量布线宽度:”))
(setq xs (getint “线条数:”))
(initget 7)
(setq jk (/ dist (+ 1 (* 2 xs))))
(prompt “平均间距:” )
(prin1 (* 2 jk))
(setq xjj (getreal “线间距:”))
(setq dist (/ (- dist (* (+ xs 1) xjj)) xs))
(prompt “选择基线:”)
(while (= obj1 nil)
(setq obj1 (entsel)))
(initget 1)
(setq pt1 (getpoint “在布线侧任取一点:”))
(setq xhs (+ 1 xs))
(while (not (= b xhs))
(progn
(setq aaa (car obj1))
(setq d 1)
(while (/= d 3)
(if (= 1 d)
(setq a (rtos (+ (atof a) xjj) 2))
(setq a (rtos (+ (atof a ) dist) 2)))
(command “_.offset” a aaa pt1 “”)
(setq d (+ 1 d)))
(setq b (+ 1 b))
);end progn
);end while
(prompt “图层转换:”)
(setq obj1 (ssget))
(while (/= obj1 nil)
(setq a (getstring “选择图层:”))
(command “chprop” “p” “” “la” a “”))
(princ)))
从网上找了个程序 不能用 哪个大侠 弄下

longer1000 发表于 2012-3-26 13:10:55

咱不懂啊!!!!!!!!

xyh 发表于 2012-3-27 12:30:25

(defun C:XX ()
(setq a 0)
(setq b 1)
(setq dist (getdist "测量布线宽度:"))
(setq xs (getint "线条数:"))
(initget 7)
(setq jk (/ dist (+ 1 (* 2 xs))))
(prompt "平均间距:" )
(prin1 (* 2 jk))
(setq xjj (getreal "线间距:"))
(setq dist (/ (- dist (* (+ xs 1) xjj)) xs))
(prompt "选择基线:")
;(while (= obj1 nil)
;(setq obj1 (entsel"选择基线:")))
(initget 1)
(setq obj1 (entsel))
(initget 1)
(setq pt1 (getpoint "在布线侧任取一点:"))
(setq xhs (+ 1 xs))
(while (not (= b xhs))
(progn
(setq aaa (car obj1))
(setq d 1)
(while (/= d 3)
(if (= 1 d)
;(setq a (rtos (+ (atof a) xjj) 2))
;(setq a (rtos (+ (atof a ) dist) 2)))
(setq a (atof (rtos (+ a xjj) 2)))
(setq a (atof (rtos (+ a dist) 2))))
(command "_.offset" a aaa pt1 "")
(setq d (+ 1 d)))
(setq b (+ 1 b))
);end progn
);end while
(prompt "图层转换:")
(setq obj1 (ssget))
(while (/= obj1 nil)
(setq a (getstring "选择图层:"))
(command "chprop" "p" "" "la" a "")
(setq obj1 nil))
(princ))
页: [1]
查看完整版本: 求助