明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 2898|回复: 17

我我是个新手这个程序有点错误谁帮我看看

  [复制链接]
发表于 2004-4-20 00:03:00 | 显示全部楼层 |阅读模式
//----------钢束伸长量-------------
scl:dialog{
label="钢束伸长量";
:boxed_column{label="请输入数据^_^";
:row{
:row{
:edit_box {label="l";key="l";edit_width=10;}
:text {label="cm";}
}
:row{
:edit_box {label="ap";key="ap";edit_width=10;}
:text {label="mm^2";}
}
}
:row{
:row{
:edit_box {label="p";key="p";edit_width=10;}
:text {label="KN";}
}
:row{
:edit_box {label="x";key="x";edit_width=10;}
:text {label="cm ";}
}
}
:row{
:row{
:edit_box{label="θ";key="s";edit_width=10;}
:text{label="度";}
}
:edit_box{label="字高";key="zg";edit_width=10;}
}
:row{
:edit_box{label="k";key="k";edit_width=10;}
:edit_box{label="u";key="u";edit_width=10;}
}
}
:boxed_radio_column{label="预应力筋的弹性模量";
:radio_button{label="钢绞线";key="ep1";value="1.9";}
:radio_button{label="冷拔低碳钢丝";key="ep2";value="1.8";}
:radio_button{label="冷拉钢筋、热处理钢筋、碳素(刻痕)钢丝";
key="ep3";value="2.0";}
}
:row{
:button{label="开始计算";key="ksjs";}
spacer_1;
cancel_button;
}
:boxed_radio_column{label="参数说明";
:text{label="l--预应力筋长度";}
:text{label="ap--预应力筋截面面积";}
:text{label="p--预应力筋张拉端的张拉力";}
:text{label="x--从张拉端至计算截面的孔道长";}
:text{label="θ--从张拉端至计算截面曲线孔道部分切线的夹角";}
:text{label="k--孔道每米局部偏差对摩擦的影响系数";}
:text{label="u--预应力筋与孔道壁的摩擦系数";}
}
} ;scl-预应力钢束理论伸长量
(defun c:scl1()
(setvar "cmdecho" 0)
(scl_sjdq)
)
(defun scl_sjdq()
(setq scl_id (load_dialog "D:\\快捷工具\\scl.dcl"))
(new_dialog "scl" scl_id)
(ok_duqushuju)
(setq defkey1 "ep1")
(set_tile defkey1 "1")
(setq 1ep (atof (get_attr defkey1 "value")))
(action_tile "ep1" "(setq 1ep (atof (get_attr $key \"value\")))")
(action_tile "ep2" "(setq 1ep (atof (get_attr $key \"value\")))")
(action_tile "ep3" "(setq 1ep (atof (get_attr $key \"value\")))")
(action_tile "ksjs" "(scl_js) (done_dialog 1)")
(setq dd (start_dialog))
(if (= dd 1)
(progn
(setq bzd (getpoint "\n指定文字基点:"))
(command "text" bzd zg "0" wz "")
(princ dtl)
)
)
)
(defun scl_js()
(setq p (* p1 1000))
(setq x (/ x1 100))
(setq l (* l1 10))
(setq s (* s1 (/ pi 180)))
(setq kx1 (+ (* k x) (* u s)))
(setq kx (exp (* -1 kx1)))
(setq pp (/ (* p (- 1 kx)) kx1))
(setq dl (/ (* pp l) (* ap 1ep 100000)))
(setq dtl (rtos (/ dl 10) 2))
(setq wz (strcat "钢束理论伸长量为:" dtl "厘米。"))
)
(defun ok_duqushuju()
(set_tile "l" "1462")
(set_tile "ap" "980")
(set_tile "p" "1370")
(set_tile "x" "l462")
(set_tile "s" "13.118")
(set_tile "zg" "2")
(set_tile "k" "0.0015")
(set_tile "u" "0.225")
(setq l1 (atof (get_tile "l")))
(setq ap (atof (get_tile "ap")))
(setq p1 (atof (get_tile "p")))
(setq x1 (atof (get_tile "x")))
(setq s1 (atof (get_tile "s")))
(setq k (atof (get_tile "k")))
(setq u (atof (get_tile "u")))
(setq zg (atof (get_tile "zg")))
) 他们为什么连不上
发表于 2004-4-20 07:17:00 | 显示全部楼层
The codes seems OK. Make sure the DCL file is located in "D:\\快捷工具\\"
 楼主| 发表于 2004-4-20 09:24:00 | 显示全部楼层
我这个程序连不上,就是连上后计算结果总是一个值


还有好的方法不用把“快捷工具”这个文件夹拷到固定位置吗
发表于 2004-4-20 12:24:00 | 显示全部楼层
加入"支援檔搜尋路徑"
发表于 2004-4-20 15:15:00 | 显示全部楼层
Where are the "action_tile" codes for key "l" "ap" "p" "x" "zg" "k" and "u"?
 楼主| 发表于 2004-4-20 18:43:00 | 显示全部楼层
alin哥们


能帮我改一下发上来吗
发表于 2004-4-20 19:05:00 | 显示全部楼层
确定scl.dcl在搜索路径


本帖子中包含更多资源

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

x
 楼主| 发表于 2004-4-20 20:33:00 | 显示全部楼层
阿林(alin ) 谢谢 f5612140你好 你说加入支持路径怎么加啊
 楼主| 发表于 2004-4-20 20:42:00 | 显示全部楼层
;;-----------文字乘法----------
(defun c:wc ()
(setq cm (getvar "cmdecho"))
(setq os (getvar "osmode"))
(setvar "cmdecho" 0)
(setvar "osmode" 0)
(setq qw (getint "\n 输出数值位数<2>:"))
(if (= qw nil) (setq qw 2))
(setq zg (getreal "\n 输入字高<2>:"))
(if (= zg nil) (setq zg 2))
(setq xs (getreal "\n 输入乘积系数<1>:"))
(if (= xs nil) (setq xs 1))
(princ "\n 请选择乘数:")
(setq en (ssget))
(setq he 1)
(setq dd 0)
(setq n 0)
(repeat (sslength en)
(setq enn (ssname en n))
(setq endata (entget enn))
(setq entyp (cdr (assoc 0 endata)))
(setq dd (atof(cdr (assoc 1 endata))))
(setq he (* he dd))
(setq n (1+ n))
)
(setq he1 (* he xs))
(setq pt (getpoint "\n 文字位置点:"))
(command "text" pt zg 0 (strcat (rtos he1 2 qw)) "")
(setvar "cmdecho" cm)
(setvar "osmode" os)
(prin1)
)
;;-----------文字加法----------
(defun c:wj ()
(setq cm (getvar "cmdecho"))
(setq os (getvar "osmode"))
(setvar "cmdecho" 0)
(setvar "osmode" 0)
(setq qw (getint "\n 输出数值位数<2>:"))
(if (= qw nil) (setq qw 2))
(setq zg (getreal "\n 输入字高<2>:"))
(if (= zg nil) (setq zg 2))
(princ "\n 请选择加数:")
(setq en (ssget))
(setq he 0)
(setq dd 0)
(setq n 0)
(repeat (sslength en)
(setq enn (ssname en n))
(setq endata (entget enn))
(setq entyp (cdr (assoc 0 endata)))
(setq dd (atof(cdr (assoc 1 endata))))
(setq he (+ he dd))
(setq n (1+ n))
)
(setq pt (getpoint "\n 文字位置点:"))
(command "text" pt zg 0 (strcat (rtos he 2 qw)) "")
(setvar "cmdecho" cm)
(setvar "osmode" os)
(prin1)
) 我这两个程序取少一个循环 每次在加(乘)完一组数后都要再重新运行程序 能帮我想一个办法一起可以加(乘)好多组数吗
 楼主| 发表于 2004-4-20 21:04:00 | 显示全部楼层
f5612140你好 支持路径我想到了 能在程序中加一句来解决这个问题吗
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-11-28 02:43 , Processed in 0.160830 second(s), 26 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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