- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm having some trouble with my first Fusion 360 python script. Basically, I'd like to create a script to automatically generate timing belt pulleys. I'm going to make them according to the shapes defined in this catalog.
Here is the screencast. The insert screencast url is not working: http://autode.sk/2oKWiwu
I've got a basic script that just executes. Eventually, I'll add a dialog and options for many different tooth profiles, but I'm stuck at square one for now. Please have a look at the screencast.
The couple relevant lines of code are:
# a few parameters
toothPitch = 0.080
toothWidth = 0.030
troughDepth = 0.018
#insert the line that will be the bottom of the tooth in the pulley
toothSketch.sketchCurves.sketchLines.addByTwoPoints(adsk.core.Point3D.create(-0.5*toothWidth, pulleyOD/2.0-troughDepth,0), adsk.core.Point3D.create(0.5*toothWidth, pulleyOD/2.0-troughDepth, 0))
What's strange is that the points should clearly be at an x position of -0.015" and +0.015", but they're coming in at -0.006" and +0.006" and I'm not sure why.
What's strange too is that when I do a print of the x coord of one of the points it's calculated correctly as this:
print(-0.5*toothWidth)
prints out to the "terminal" -0.015"
as you'll see in my demo.
Thanks in advance to anyone that has a look and helps me solve this.
Solved! Go to Solution.