How do i create circular pattern in sketch using API?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm wokring on a little helical gear gernerator.
I have a sketch with gear tooth outline made from a few arcs and splines.
I'm trying to make a circular pattern in the sketch to copy the teeth shape around the gear.
I can't seem to find the right API to do a Circular Pattern as I can do in the sketch editor.
I tried to use the only API that seemed to work with Circular patterns (circularPatternFeatures), but it does not work for me:
var stuff_to_pattern = adsk.core.ObjectCollection.create();
stuff_to_pattern.add(left_bottom_arc);
stuff_to_pattern.add(left_involute);
stuff_to_pattern.add(top_arc);
stuff_to_pattern.add(right_involute);
stuff_to_pattern.add(right_bottom_arc);
var pattern_input = root.features.circularPatternFeatures.createInput(stuff_to_pattern, root.zConstructionAxis);
pattern_input.quantity = adsk.core.ValueInput.createByReal(teeth);
root.features.circularPatternFeatures.add(pattern_input);
When I run this I get an error saying "inputEntities should be of a single type."
I am confused. Am I using the wrong thing?