Issue creating offset with ValueInput less than one
Hi all,
I am doing some testing to implement the new OffsetConstraintInput functionality to get code that was using the retired offset function working again. I am running in to an issue where if I try to use a ValueInput that is less than one I get an "RuntimeError: 3 : invalid argument offset distance" error thrown on this line:
offset_input = sk.geometricConstraints.createOffsetInput(line, value_input)
Seemingly any value above 1 that I have tested works, and 0.9999999999999999999 seems to get rounded up to 1 and function. Does anyone have any insight in to what is going on here? Full test code is posted below.
Thanks,
Alden
def command_execute(args: adsk.core.CommandEventArgs):
# General logging for debug.
futil.log(f'{CMD_NAME} Command Execute Event')
# TODO ******************************** Your code here ********************************
product = app.activeProduct
rootComp = adsk.fusion.Design.cast(product).rootComponent
sk = rootComp.sketches.add(rootComp.xYConstructionPlane)
point1 = sk.sketchPoints.add(rootComp.originConstructionPoint.geometry)
point2 = sk.sketchPoints.add(adsk.core.Point3D.create(10, 0, 0))
line = [sk.sketchCurves.sketchLines.addByTwoPoints(point1, point2)]
value = 0.99
value_input = adsk.core.ValueInput.createByReal(value)
offset_input = sk.geometricConstraints.createOffsetInput(line, value_input)
sk.geometricConstraints.addTwoSidesOffset(offset_input, True)