想要达到的效果如下:
做完自定义
节点,增加一个参数P1后,
inp文件内容如下:
page("TeklaStructures","")
{
joint(1, "LIZI")
{
tab_page("", " Parameters 1 ", 1)
{
parameter("HOLE_DISTANCE", "P1", distance, number, 1)
}
}
}
删除parameter("HOLE_DISTANCE", "P1", distance, number, 1)并替换为
attribute("LABEL1", "HOLE_DISTANCE:", label, "%s", no, none, "0.0", "0.0", 50, 5, 400)
attribute("P1", "", option, "%s", no, none, "0.0", "0.0", 250, 5, 200)
{
value("40",0)
value("70",0)
value("110",1)
}
保存inp并重新打开
xsteel就能看到想要的对话框了,但是它传递给P1的参数不对,不是想要的40或70或110,
我们需要新加一个参数P2,当选择
列表框中的第一行时,P1会得到一个值0,第二行1,第三行2,以此类推,
所以要添加一行语句,
P2=if (P1==2) then 110 else (if (P1==1) then 70 else 40 endif) endif
这样,列表框里的数值就正确地传递给了P2。
[ 此帖被wintersuns在2011-04-14 23:02重新编辑 ]