The code below creates a circle, a line, and a coincident constraint between them.
import adsk.core, adsk.fusion, traceback
def run(context):
try:
app = adsk.core.Application.get()
ui = app.userInterface
des = adsk.fusion.Design.cast(app.activeProduct)
root = des.rootComponent
sk = root.sketches.add(root.xYConstructionPlane)
circle = sk.sketchCurves.sketchCircles.addByCenterRadius(
adsk.core.Point3D.create(0,0,0), 5)
line = sk.sketchCurves.sketchLines.addByTwoPoints(
adsk.core.Point3D.create(5,0,0),
adsk.core.Point3D.create(8,3,0))
sk.geometricConstraints.addCoincident(line.startSketchPoint, circle)
except:
if ui:
ui.messageBox('Failed:\n{}'.format(traceback.format_exc()))
---------------------------------------------------------------
Brian EkinsInventor and Fusion 360 API Expert
Website/Blog:
https://EkinsSolutions.com