I love me a little Script DAT love - it makes for lovely programmatic export tables, but on the regular I find myself doing this dance:
[code]def onCook(scriptOp):
scriptOp.clear()
exportPars = []
headerRow = ['path', 'parameter', 'value', 'enable']
exportPars.append(headerRow)
# set up a list to be exported
# exportPars.append(new_export)
for each_par in exportPars:
scriptOp.appendRow(each_par)
return
[/code]
Most of that doesn’t bother me… it’s all process, BUT I would love to have a built-in member for that export list header.
An alternative would be to change the default setup example in the script DAT contents to:
def onSetupParameters(scriptOp):
page = scriptOp.appendCustomPage('Custom')
p = page.appendFloat('Valuea', label='Value A')
p[0].default = 0
p = page.appendFloat('Valueb', label='Value B')
p[0].default = 1
p = page.appendStr('Headerlist', label="Header List")
p[0].default = 'path parameter value enable'
return
That would let me just use something like this:
[code]def onCook(scriptOp):
scriptOp.clear()
exportPars = []
exportPars.append( scriptOp.par.Headerlist.val.split() )
for each_par in exportPars:
scriptOp.appendRow(each_par)
return[/code]
Which would be almost as good as having a built-in, and also shows off that you can set default vals for custom parameters.
The catch here is that as currently built, I have to manually right click and “Reset Parameter” for the new default to populate. So I guess a follow up request would be for defaults to be set if present when the setup parameters par is pulsed.