First make a polygon with three (or more) sides and set its X and Y cordinates at zero.
Click 'Script' then 'Editor'
Copy this code into the editor.
Adjust the first five parameters to what you would like.
Press 'F5' to run the code.
Code: Select all
Sub Main()
Ro = 1.000 'outside Radius
Td = 0.05 'Tooth depth
Ar = 0.250 'Angle relief
Nt = 60 'Number of teeth
CW = 1 'CW = 1 else = 0 for CCW
Rr = Ro - Td 'Root radius
T$ = ""
For a = 0 to 359 step 360 / Nt
If CW then 'Teeth point CW
T$ = T$ + Format$(Rr, "0.000") + Chr$(9)
T$ = T$ + Format$(a + Ar, "0.000")
T$ = T$ + Chr$(13) + Chr$(10)
T$ = T$ + Format$(Ro, "0.000") + Chr$(9)
T$ = T$ + Format$(a, "0.000")
T$ = T$ + Chr$(13) + Chr$(10)
Else 'Teeth point CCW
T$ = T$ + Format$(Ro, "0.000") + Chr$(9)
T$ = T$ + Format$(a, "0.000")
T$ = T$ + Chr$(13) + Chr$(10)
T$ = T$ + Format$(Rr, "0.000") + Chr$(9)
T$ = T$ + Format$(a + Ar, "0.000")
T$ = T$ + Chr$(13) + Chr$(10)
End If
Next
Clipboard.SetText T$
T$ = "Data is in clipboard, ready to paste."
T$ = T$ + Chr$(13) + Chr$(10) + "Set Geometry "
T$ = T$ + "to 'Curved Body' and 'Shape coordinates'"
T$ = T$ + Chr$(13) + Chr$(10)
T$ = T$ + "then click 'Paste' and unclick 'Curved Body'."
Msgbox T$
End Sub
Pin the rectangle and the rachet together or to other objects that rotate. If you need a number of objects that ratchet around a single point then you only need one ratchet wheel with numerous pawls.
Enjoy!