1.getinput函数功能:
运行脚本后,提供一个对话框,用户可输入多个参数,以上参数将用于后续建模中,可直观地进行建模操作。默认输入的数据类型为字符串类型。如下图。
用户输入参数对话框示例
2.getinput函数介绍:
Getinput函数:输入单一变量。
必须参数(prompt):字符串型。
可选参数(default):默认参数数值。
#一次性输入一个变量
getInput('Enter a number: \t Enter the number of nodes to delete') #一次性输入一个变量||\t从对话框中提供工具提示
输入单个参数对话框示例
getInput函数介绍(图源:abaqus用户手册)
3.getinputs函数介绍:
Getinputs函数功能:输入多个变量(getinput函数只能输入一个变量),如下图。Fields是标签名及输入参数。Label为对话框顶部标签。
必须参数(fields):为字符串的元组的元组。内部元组包含两个字符串,第一个字符串为标签,第二个字符串为输入参数(可写入默认参数)。
可选参数(label):对话框顶部标题。
data_num = getInputs(fields=(('please enter the value of length :', '6'), #字符串的元组的元组
('please enter the value of width :', '66'), #内部元组inner sequence包含两个字符串,第一个字符串是标签名,第二个字符串是默认输入值
('please enter the value of heigth :', '666'),
('please enter the value of layer :', '6666')),
label=' a label to be placed at the top of the dialog box'
) #data_num为list类型
用户输入多参数对话框示例