Message 1 of 4
Extend Feature: RuntimeError: 5 : Some input argument is invalid.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hey!
I created a Python add-in several years ago called `Guitar Engine`. I haven't made many changes to it in over 3 years. As of a few updates ago the script no longer properly functions and I can't figure out it.
I receive this error now:
Failed:
Traceback (most recent call last):
File "C:/Users/brad/AppData/Roaming/Autodesk/Autodesk Fusion 360/API/AddIns/Guitar Engine [Beta]/Guitar Engine [Beta].py", line 1512, in buildFretboard
extendFeature1 = extendFeatures.add(extendFeatureInput1)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users/brad/AppData/Local/Autodesk/webdeploy/production/fd081b4c15f2fc37998034adb20de16163fc298f/Api/Python/packages\adsk\fusion.py", line 20197, in add
return _fusion.ExtendFeatures_add(self, input)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: 5 : Some input argument is invalid.
Here's the tidbit of code this is referencing:
# Get the body created by the stitch
face = stitch.bodies.item(0)
if createFilletRadius.value:
topFace = face.faces.item(6)
else:
topFace = face.faces.item(4)
# Create input entities for offset feature
inputEntities = adsk.core.ObjectCollection.create()
inputEntities.add(topFace)
# Create an input for offset feature
offsetFeature = fretboardComp.features.offsetFeatures
offsetInput = offsetFeature.createInput(inputEntities, adsk.core.ValueInput.createByReal(-tangDepth),
adsk.fusion.FeatureOperations.NewBodyFeatureOperation)
#Get the surface body.
extrudeFeature = offsetFeature.add(offsetInput)
extrudeFeature.name = 'Offset: Fret Projections'
offSurf = extrudeFeature.bodies.item(0)
offSurf.name = 'Reference for fret cuts'
offSurf.isVisible = False
#Get an edge from surface, and add it to object collection.
extend = offSurf.edges
ext1 = extend.item(0)
ext2 = extend.item(1)
ext3 = extend.item(2)
ext4 = extend.item(3)
inputEdges = adsk.core.ObjectCollection.create()
inputEdges.add(ext1)
inputEdges.add(ext2)
inputEdges.add(ext3)
inputEdges.add(ext4)
#Define a distance to extend.
distance = adsk.core.ValueInput.createByString('0.5 in')
#Create an extend input to be able to define the input needed for an extend.
extendFeatures = fretboardComp.features.extendFeatures
extendFeatureInput1 = extendFeatures.createInput(inputEdges, distance, adsk.fusion.SurfaceExtendTypes.NaturalSurfaceExtendType)
#Create an extend feature.
extendFeature1 = extendFeatures.add(extendFeatureInput1)
extendFeature1.name = 'Extend: Fret Projections'
Line 37 is Line 1512 in my script. `extendFeature1 = extendFeatures.add(extendFeatureInput1)`
I've tried to trace backward to see why all of a sudden this creates the error but I can't figure it out.
The code in its entirety is here >> https://github.com/bradandersonjr/GuitarEngine/blob/master/Guitar%20Engine%20%5BBeta%5D.py
I know it's not pretty and needs to eventually be overhauled.
I appreciate any guidance or help offered!
Thank you!