明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 3142|回复: 2

求助

[复制链接]
发表于 2012-3-26 12:43 | 显示全部楼层 |阅读模式
(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)))
从网上找了个程序 不能用 哪个大侠 弄下
发表于 2012-3-26 13:10 | 显示全部楼层
咱不懂啊!!!!!!!!
发表于 2012-3-27 12:30 | 显示全部楼层
(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))
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2024-5-11 17:47 , Processed in 0.140355 second(s), 27 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表