- 积分
- 549
- 明经币
- 个
- 注册时间
- 2014-5-16
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
本帖最后由 hrbustmqc 于 2015-3-2 17:55 编辑
(defun c:tt()
(setvar "cmdecho" 0)
(setq old (getvar "OSMODE"))
(setvar "osmode" 0)
(command "style" "HZS" "romanc.shx,msi_fsx.shx" "0" "0.7" "0" "n" "n" "N" )
(command "insert" "E:\\图库\\图库.dwg" "0,0" "1" "" "")
(entdel(entlast))
(setq branchpt (getpoint "选择插入点"))
(setq Lst '(("wl1" "AL1" "单相" "1.44")
("wl3" "AL2" "三相" "2")
("wl2" "AL2" "三相" "2")
("wl2" "AL1" "单相" "2")
("wl3" "AL2" "三相" "5")
("wl1" "AL2" "单相" "2")
("wl2" "AL2" "单相" "2")
("wl3" "AL3" "三相" "2")
("wp2" "AL2" "三相" "4")
))
(setq Distribution_Box "AL1" )
(drawing Distribution_Box Lst )
(setvar "osmode" old)
(prin1)
)
(defun drawing ( Distribution_Box Lst )
(setq i 0)
(setq Phase_Number 1)
(repeat (length Lst)
(setq Lst1 (nth i Lst))
(if (and (= (cadr Lst1) Distribution_Box ) (=(caddr Lst1) "单相"))
(progn
(cond
( (wcmatch (car Lst) "zm*")
(progn (setq Circuit_Breaker "CH2-63C/16/1") (setq Circuit_Name (car Lst))
(setq Load_Power (cadddr Lst)) (setq Wire&Cable "ZRBV-3x2.5S15FC")
(branch1 branchpt ))
)
( (wcmatch (car Lst) "byzm*")
(progn (setq Circuit_Breaker "CH2-63C/16/1") (setq Circuit_Name (car Lst))
(setq Load_Power (cadddr Lst)) (setq Wire&Cable "ZRBV-4x2.5S25FC")
(branch2 branchpt ) )
)
( (wcmatch (car Lst) "cz*")
(progn (setq Circuit_Breaker "CH2-63C/20/2 30mA") (setq Circuit_Name (car Lst))
(setq Load_Power (cadddr Lst)) (setq Wire&Cable "ZRBV-3x4S25FC")
(branch1 branchpt ) )
)
)
)
)
)
)
(defun branch1 (branchpt)
(setq pt1 branchpt)
(setq pt2 (polar pt1 0 750))
(command "pline" pt1 "H" 17.5 17.5 pt2 "")
(command "insert" "断路器" pt2 "1500" "" "90" )
(setq pt3 (polar pt2 0 1500))
(setq pt4 (polar pt3 0 5250))
(command "pline" pt3 "H" 17.5 17.5 pt4 "")
(setq pt5 (polar pt1 0 250))
(setq pt6 (polar pt5 (* pi 0.5) 120))
(command "text" "s" "hzs" "j" "bl" pt6 300 0 Circuit_Breaker) ;断路器型号
(setq pt7 (polar pt6 0 5700))
(command "text" "s" "hzs" "j" "bl" pt7 300 0 Load_Power);负载功率
(setq pt8 (polar pt4 0 600))
(command "text" "s" "hzs" "j" "ml" pt8 300 0 Circuit_Name);回路名称
(setq pt9 (polar pt4 0 1900))
(command "text" "s" "hzs" "j" "ml" pt9 300 0 Wire&Cable);导线&电缆
(setq pt10 (polar pt6 0 4500))
(command "text" "s" "hzs" "j" "ml" pt10 300 0 Circuit_Phase);回路相位
(setq branchpt (polar branchpt (* pi -0.5) 750))
(princ)
)
(defun Phase ()
(setq Circuit_Phase (strcat (itoa Phase_Number) (nth (rem Phase_Number 3) '("c" "a" "b"))))
(1+ Phase_Number)
)
请高人看看这个程序哪里错了,还有救么,总提示参数类型错误: stringp ("wl1" "AL1" "单相" "1.44")
关于参数怎么传递,什么时候用全局的,我总是糊涂,真心请教! |
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有账号?注册
x
|