Gear script problem.

Gear script problem.

HughesTooling
Consultant Consultant
2,135 Views
6 Replies
Message 1 of 7

Gear script problem.

HughesTooling
Consultant
Consultant

I've modified the sample gear script to use Modular inputs. All seemed ok until I tried to produce a gear with 50 teeth and you get this error message.

 

Clipboard01.png

 

I then tried the original gear script and it gives the same error. I think the problem happens when the involute form goes below the base circle.

I've tried to debug the program but I don't know a lot about Python and can't figure out how to run a debug on this program.

 

I've attached the modified script you need to extract the zip file "SuprGearModular.py" and the SpurGear subdirectory to
C:\Users\Your User Name\AppData\Roaming\Autodesk\Autodesk Fusion 360\API\Scripts

In the line above replace "Your User Name" with your user name.

 

The scripts run OK as long as you have less than about 35 teeth.

 

Mark.

 

Mark Hughes
Owner, Hughes Tooling
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


0 Likes
Accepted solutions (1)
2,136 Views
6 Replies
Replies (6)
Message 2 of 7

ekinsb
Alumni
Alumni
Accepted solution

I didn't take the time to debug the existing sample but have been working on a new improved sample that I've attached.  This uses a GUI toolkit that comes with Python called Tkinter to create a dialog.  I tested creating a gear with 50 teeth and it works fine.  This sample also creates each gear in its own component so it's much easier to use to build up an assembly.  To use it just unzip the directory anywhere on your system, open "Scripts Manager" inside Fusion and right-click next to "My Scripts" to use the Add to browse and add this script to the list.  You can now execute it from the Scripts Manager.

 

GearExample.gif


Brian Ekins
Inventor and Fusion 360 API Expert
Mod the Machine blog
Message 3 of 7

HughesTooling
Consultant
Consultant

Hello Brian

Thanks for the script, looks nice and doesn't complain about to many teeth.

I modified a copy to produce metric gears but it wanted to make the gears 10 times the correct size, does the script work in cementers? I got the script working by adding divide by 10 in a few places but I'm not sure if this line need changing as well, or is there a way to make the script work in mm.

 

dedendum = (1.2 * diametralPitch) + (.002 * 2.54)

 

 

I've attached the script with a modified gif file.

Thanks Mark

Mark Hughes
Owner, Hughes Tooling
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


0 Likes
Message 4 of 7

HughesTooling
Consultant
Consultant

Spotted a mistake in the first script, this one should be correct. Also changed the root fillet rad to be a percentage of the Modular.

 

Mark.

Mark Hughes
Owner, Hughes Tooling
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


Message 5 of 7

Willa1980
Advocate
Advocate

Hi,

this script might be very helpful also to me if it would run also on OSX... Currently, Fusion just stops responding when I run the script. On my personal win8 machine however, it runs perfectly. Where might the problem come from? I've seen that you even took care of different operating systems by including e.g. code like 

imageFile = os.patch.join(... etc

I can also not debug the code on OSX, Fusion just doesn't do anything if I click "debug" in the Script window.

 

Any idea...?

0 Likes
Message 6 of 7

KrisKaplan
Autodesk
Autodesk

That script is using tkinter for its GUI.  Unfortunately, on the Mac, there is an incompatibility with tkinter and Qt used by the Fusion host process.  So far, we have been unsuccessful in getting tkinter to behave in the Fusion process on the Mac.  We are definitely still very interested in getting tkinter to work on the Mac, but right now there is no workaround to get this to work.

 

Kris



Kris Kaplan
Message 7 of 7

Willa1980
Advocate
Advocate
ok, thanks!
0 Likes