Message 1 of 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm getting an error when I try to add a custom feature definition during the run() function like this:
global _waterlineCustomFeatureDef
_waterlineCustomFeatureDef = adsk.fusion.CustomFeatureDefinition.create('sgraffeWaterline',
'Water Line',
'Resources/CustomPocket')
_waterlineCustomFeatureDef.editCommandId = 'sgraffeWaterlineEdit'
# Connect to the compute event for the custom feature.
computeCustomFeature = ComputeWaterLineCustomFeature()
_waterlineCustomFeatureDef.customFeatureCompute.add(computeCustomFeature)
_handlers.append(computeCustomFeature)
But I get this error about the editCommandId being invalid:
Failed: Traceback (most recent call last):
File "C:/Users/sgraf/Documents/sources/fusion-360-addins/WaterLine/WaterLine.py", line 143, in run
_waterlineCustomFeatureDef.editCommandId = 'sgraffeWaterlineEdit'
File "C:/Users/sgraf/AppData/Local/Autodesk/webdeploy/production/090497a6fd58c652eeadc96ef980caa6ca71c3c6/Api/Python/packages\adsk\fusion.py", line 13807, in _set_editCommandId
return _fusion.CustomFeatureDefinition__set_editCommandId(self, value)
RuntimeError: 3 : Invalid command Id
Why? The API docs make it sound like it's an arbitrary string, but it's apparently not. I even tried to substitute the ID from the CustomPocket example into here, but I get the same result.
Solved! Go to Solution.