Here's a script that I believe does what you want.
import adsk.core, adsk.fusion, traceback
def main():
ui = None
try:
app = adsk.core.Application.get()
design = app.activeProduct
# Read the csv file.
cnt = 0
file = open('C://Temp//values.csv')
for line in file:
# Get the values from the csv file.
pieces = line.split(',')
length = pieces[0]
width = pieces[1]
height = pieces[2]
# Set the parameters.
lengthParam = design.userParameters.itemByName('Length')
lengthParam.expression = length
widthParam = design.userParameters.itemByName('Width')
widthParam.expression = width
heightParam = design.userParameters.itemByName('Height')
heightParam.expression = height
#Export the STEP file.
exportMgr = design.exportManager
stepOptions = exportMgr.createSTEPExportOptions('C:\\Temp\\test_box' + str(cnt) + '.stp')
cnt += 1
res = exportMgr.execute(stepOptions)
ui = app.userInterface
ui.messageBox('Finished')
except:
if ui:
ui.messageBox('Failed:\n{}'.format(traceback.format_exc()))
main()
It's using the expression property of the Parameter object you can use any valid expression just like you would type in the parmaters dialog. For my test I had a box with the parameters Length, Width, and Height. Here's the contents of my csv to demonstrate the various options.
4 in, 3 in, 1 in
3, 2, 1
3 cm, 2 cm, Length/2
5, 5, 4,