Message 1 of 6

Not applicable
03-11-2021
08:40 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
Just started to use the Fusion 360 python API today, and I've been progressing slowly, but I'm now completely stumped. I've been unable to find out how to create an offset in a sketch for a spline that I've created which is based on a user parameter. I've tried the following things:
# ...code to create points of curve...
curves = sketch.findConnectedCurves(spline)
# Create the offset
dirPoint = adsk.core.Point3D.create(0, 0.5, 0)
paramRingThickness = userParams.itemByName('ring_thickness')
# All of the below 'ringThickness' attempts failed
# ringThickness = adsk.core.ValueInput.createByString(paramRingThickness.name)
# ringThickness = adsk.core.ValueInput.createByReal(4)
# ringThickness = adsk.core.ValueInput.createByString("40 mm")
ringThickness = adsk.core.ValueInput.createByString("ring_thickness")
offsetCurves = sketch.offset(curves, dirPoint, ringThickness)
Which all result in the same error about `TypeError: Wrong number or type of arguments for overloaded function 'Sketch_offset'`
Thank you for any assistance!
Solved! Go to Solution.