Message 1 of 8
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
My first try at scripting so please bear with me.
I have gone through the forum and tried lots of different examples, but nothing seem to work.
I am reading a csv file and then trying to create some user parameters.
I am reading the file ok and get the correct values, but when I try to create the parameters, BOOM:
This is the code in question:
cnt = 0
file = open('C:/Users/bradb/AppData/Roaming/Autodesk/Autodesk Fusion 360/API/Scripts/SHCStest/SHCS-IMPERIAL.csv')
for line in file:
# Get the values from the csv file.
pieces = line.split(',')
if pieces[0] == '1/2-13':
ScrewDiameter = pieces[1]
HeadDiameter = pieces[2]
HexSize = pieces[4]
TapDrill = pieces[5]
HeadFillet = pieces[6]
# Create user parameters
# Set the parameters.
ScrewDiameterParam = design.userParameters
ScrewDiameterParam.add('ScrewDiameter', ScrewDiameter, 'in', '')
Being new I am not sure how to track down the proper syntax, arguments, etc in the documentation.
Any help is appreciated.
Thank you in advance.
Brad
Brad Bylls
Solved! Go to Solution.