Hi @grosfaignan ,
Here you have a fragment of python code to create sketch lines and dimension one of them with a user parameter:
app: adsk.core.Application = adsk.core.Application.get()
DISTANCE_PARAMETER = 'distance'
design = adsk.fusion.Design.cast(app.activeProduct)
# 1) user parameter
distParam = design.userParameters.itemByName(DISTANCE_PARAMETER)
if not distParam:
# create user parameter if not found
distVal = adsk.core.ValueInput.createByString('35 mm')
distParam = design.userParameters.add(DISTANCE_PARAMETER, distVal, 'mm', '')
# 2) sketch
rootComp = adsk.fusion.Component.cast(design.rootComponent)
# Create a new sketch on the xy plane.
sketches = rootComp.sketches
sketch = sketches.itemByName('xySketch')
sketch.areDimensionsShown = True #display dimensions on the sketch
if not sketch:
# create sketch if not found
xyPlane = rootComp.xYConstructionPlane
sketch = adsk.fusion.Sketch.cast(sketches.add(xyPlane))
sketch.name = 'xySketch'
# 3) create sketch points
p1 = sketch.sketchPoints.add(adsk.core.Point3D.create(1, 0, 0))
p2 = sketch.sketchPoints.add(adsk.core.Point3D.create(3, 1, 0))
# 4) create 2 lines, sharing p1 as a coincident constraint
line1 = sketch.sketchCurves.sketchLines.addByTwoPoints(sketch.originPoint, p1)
line2 = sketch.sketchCurves.sketchLines.addByTwoPoints(p1, p2)
# 5) add dimension to line1
sld = sketch.sketchDimensions.addDistanceDimension(sketch.originPoint, p1, adsk.fusion.DimensionOrientations.AlignedDimensionOrientation, adsk.core.Point3D.create(0, 2, 0))
# 6) get model parameter from the sketch dimension and assign a user parameter to its expression
modelParam = adsk.fusion.ModelParameter.cast(sld.parameter)
modelParam.expression = DISTANCE_PARAMETER
This is the result:

Hope it helps.
Let me know if it works for you.
Regards,
Jorge