In my experience (in both F360 and DS S*works), circular patterns are better done in feature space rather than sketches, because both tools allow much better after-the-fact editing of patterns in feature space rather than sketch space. It would seem that the API for feature patterns is much better than in sketch space, per my reading of the documentation.
This doesn't solve your general problem (i.e. CircularPatternConstraints in a sketch), but in the case of gears, all of gear implementations I've seen use the "patterned notch" method:
- Draw the involute and root curves at the proper radius and offset from the x-axis (in the case of F360, you would want to have key parameters, like module, Nteeth, pressure angle, etc in the User Parameters)
- Mirror the curves across the x-axis.
- Draw a circle connecting to the tip and an arc between the dedendum points. Your sketch is now complete.
- Extrude the (complete) outer circle.
- Cut the notch.
- Add goodies like fillets if your root curve needs them.
- Do a *feature* circular pattern of the modified notch, using the Nteeth User Parameter.
This is basically how the F360 SpurGear add-in works, though to my eye the gear curve code therein seems very complex (no offense intended to @BrianEkins , the implementer of that code). All of the above could be implemented in a fairly straightforward fashion in API code, I'm pretty sure. It helps to have good equations for the involute tooth and trochoidal root curves (depending upon your desire for accuracy and the intended method for cutting the gear).
I also need to add that when changing parameters and moving a spline that is parametrically-generated, you will need to disable, then re-enable all the constraints associated with that spline. This is not trivial. It is a battle-of-wills with the sketch solver, which definitely does not let a user move an otherwise-unconstrained SketchPoint anywhere he chooses.
Hope this helps, and YMMV...