明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 3715|回复: 6

在网上找的不能用 求解决

[复制链接]
发表于 2012-3-26 16:08:40 | 显示全部楼层 |阅读模式
(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 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 22:50:10 | 显示全部楼层
可以用了,是否合乎要求
(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))
 楼主| 发表于 2012-3-28 10:51:01 | 显示全部楼层
xyh 发表于 2012-3-26 22:50
可以用了,是否合乎要求
(defun C:XX ()
(setq a 0)

可以了  谢谢
 楼主| 发表于 2012-3-28 12:35:45 | 显示全部楼层
里面这个功能怎么实现

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册

x
 楼主| 发表于 2012-3-29 09:41:20 | 显示全部楼层
求此插件功能 能破解最好

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册

x
 楼主| 发表于 2012-3-30 07:53:42 | 显示全部楼层
能不能把下面的程序结果改成是双线,若单线和双线可以自由选择就更完美了

(defun C:a2 ()
(setq A nil)
(setq OM (getvar "OSMODE"))
(setvar "OSMODE" 33)
(setq PNT1 (getpoint "\n方向起点: "))
(setq PNT2 (getpoint "\n方向终点: " PNT1))(terpri)
(initget 1 "M E N")
(prompt "\n选择复制方式: ")
(setq CTYPE
(getkword "[最大间距(M)/精确间距(E)/数量(N)]: "))
(if (= CTYPE "M")
(setq SP (getdist "\n最大对象间距: ")))
(if (= CTYPE "E")
(setq SP (getdist "\n精确对象间距: ")))
(if (= CTYPE "N")
(setq SP (getreal "\n对象数量: ")))
(setq DIST (distance PNT1 PNT2))
(setq ANG (angle PNT1 PNT2))
(setq TEMP1 (/ DIST SP))
(setq TEMP2 (fix (/ DIST SP)))
(setq INC1 SP)
(setq INC2 (/ DIST (+ 1 (fix (/ DIST SP)))))
(setq INC3 (/ DIST (- SP 1)))
(if (= TEMP1 TEMP2) (setq INC INC1) (setq INC INC2))
(if (= CTYPE "E") (setq INC INC1) (setq INC INC))
(if (= CTYPE "N") (setq INC INC3) (setq INC INC))
(setq TMS (FIX (+ 0.00001 (/ DIST INC))))
(setvar "OSMODE" 0)
(setq A (ssget))
(setq INCR 0)
(repeat TMS
(setq INCR (+ INCR INC))
(setq NEWPT (polar PNT1 ANG INCR))
(command "copy" A "" PNT1 NEWPT)
)
(setvar "OSMODE" OM)
(setq A nil)
)
发表于 2012-4-18 20:05:14 | 显示全部楼层
feng8511 发表于 2012-3-29 09:41
求此插件功能 能破解最好

蜀山的东西。你电子行业的?

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

GMT+8, 2024-11-6 09:27 , Processed in 0.181990 second(s), 28 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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