Error when adding custom feature

Error when adding custom feature

crazybrain13
Contributor Contributor
200 Views
2 Replies
Message 1 of 3

Error when adding custom feature

crazybrain13
Contributor
Contributor

I am working on an addin that will add a custom feature to make parametric helical patterns of objects. So far i have the core functionality of the execute command working as intended.

Helix Pattern Test v15.png

However, I get a runtime error when I try to add the customFeatureInput.

 

Failed:

Traceback (most recent call last):

File "C:/Users/shopuser/AppData/Roaming/Autodesk/Autodesk Fusion 360/API/AddIns/HelicalPattern/HelicalPattern.py", line 186, in notify

features.customFeatures.add(customFeatInput)

File "C:\Users/shopuser/AppData/Local/Autodesk/webdeploy/production/7627f627889be835182cfc345110c3c9f5bc9cc3/Api/Python/packages\adsk\fusion.py", line 22142, in add

return _fusion.CustomFeatures_add(self, input)

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

RuntimeError: 3 : make params invalid

 

I have tried many different combinations of things to try to make this work to no avail. Does anyone know what this means or how to fix it?

 

I have attached what I have for my addin so far as a .txt

0 Likes
201 Views
2 Replies
Replies (2)
Message 2 of 3

Jorge_Jaramillo
Collaborator
Collaborator

Hi,

 

I have the following remarks about your AddIn:

- Did you tried creating the CustomFeature without any of the 3 parameters? Just to check the parameters are not an issue.

- Did you checked the result value from each of the customFeatInput.addCustomParameter() method call?  It returns a boolean, which indicates the parameter is well defined for the feature.

- Or maybe, try creating the CustomFeature with a single parameter at a time, so you can check which parameter is making it to fail.

- This is not the cause of your problem, but it could be an issue later: the global variables design, root and defaultLengthUnits depends on the document over the AddIn will work on; so, you should set them in the CommandCreateHandler with the active design.  The way you have them set, they reference the active at the moment the AddIn is being activated.

 

I hope this can help out.

 

Regards,

Jorge Jaramillo

 

0 Likes
Message 3 of 3

crazybrain13
Contributor
Contributor

Thanks for the input!

 

Yes, I did try creating the customFeature without any of the parameters, and the issue still happens. I also checked the return values for customFeatureInput.addCustomParameter() method call, and they all returned true. I even tried singling out each parameter, still the same error.

 

Thanks for the heads up about my global variables. I moved the assignment for those variables into the CommandCreatedHandler.

 

This really has me stumped. From everything I can see, I have set this up exactly like the documentation says and It's just not working. I just keep assuming I must have done something wrong somewhere because I can't find any information about this error and no one else in the forums has posted anything about it.

0 Likes