Hi @jphalip .
Primitives, including coils, are provided with objects, but the API does not seem to provide a way to create them.
Instead, I tried to create them using text commands.
# Fusion360API Python script
import traceback
import adsk.fusion
import adsk.core
import math
def run(context):
ui = adsk.core.UserInterface.cast(None)
try:
app: adsk.core.Application = adsk.core.Application.get()
ui = app.userInterface
des: adsk.fusion.Design = app.activeProduct
root: adsk.fusion.Component = des.rootComponent
coilFeat: adsk.fusion.CoilFeature = create_coil(
root,
adsk.core.Point3D.create(2, 1, 0),
1.0,
4.0,
3.0,
15.0,
0.5
)
except:
if ui:
ui.messageBox('Failed:\n{}'.format(traceback.format_exc()))
def create_coil(
comp: adsk.fusion.Component,
center: adsk.core.Point3D,
coilDiameter: float,
coilRevolutions: float,
coilHeight: float,
coilTaperAngle_deg: float,
sectionSize: float):
skt: adsk.fusion.Sketch = comp.sketches.add(
comp.xYConstructionPlane
)
sktCircles: adsk.fusion.SketchCircles = skt.sketchCurves.sketchCircles
circle: adsk.fusion.SketchCircle = sktCircles.addByCenterRadius(
center,
coilDiameter * 0.5
)
comp: adsk.fusion.Component = circle.parentSketch.parentComponent
app: adsk.core.Application = adsk.core.Application.get()
ui: adsk.core.UserInterface = app.userInterface
sels: adsk.core.Selections = ui.activeSelections
sels.clear()
sels.add(circle)
app.executeTextCommand(u'Commands.Start Coil')
app.executeTextCommand(u'Commands.SetString infoSizeType infoRevolutionAndHeight')
app.executeTextCommand(u'Commands.SetDouble CoilRevolutions {}'.format(coilRevolutions))
app.executeTextCommand(u'Commands.SetDouble CoilHeight {}'.format(coilHeight))
app.executeTextCommand(u'Commands.SetDouble CoilTaperAngle {}'.format(math.radians(coilTaperAngle_deg)))
app.executeTextCommand(u'Commands.SetString infoSectionType infoCircular')
app.executeTextCommand(u'Commands.SetString infoSectionPosition infoOutside')
app.executeTextCommand(u'Commands.SetDouble SectionSize {}'.format(sectionSize))
app.executeTextCommand(u'Commands.SetString infoBooleanType infoNewBodyType')
app.executeTextCommand(u'NuCommands.CommitCmd')
skt.deleteMe()
return comp.features.coilFeatures[-1]
After executing the script, it looks like this.

For more information about text commands, please read here.
https://forums.autodesk.com/t5/fusion-360-api-and-scripts/use-textcommands/m-p/9645688
https://forums.autodesk.com/t5/fusion-360-api-and-scripts/use-textcommands2/m-p/9937161