Community
Fusion API and Scripts
Got a new add-in to share? Need something specialized to be scripted? Ask questions or share what you’ve discovered with the community.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Unable to add attributes to cam Setup (Python)

3 REPLIES 3
Reply
Message 1 of 4
allan4EEKW
210 Views, 3 Replies

Unable to add attributes to cam Setup (Python)

I'm trying to save some custom attributes to a cam setup. I'm using the add method but the return value is None. I've tried the same code on a BRepBody and it works fine there so I don't think it's something I'm doing wrong. Here is a sample of the code:

materialAttribute = setup.attributes.add('TwoSevenCamTools_Group', 'material_code', 'MDF_05')
futil.log(materialAttribute.value)
 
gives the following error:

AttributeError: 'NoneType' object has no attribute 'value'

 

The functionality of this plugin relies heavily on the ability to add and save this kind of data to setups, so if the add attribute feature is not implemented for setups I'd appreciate any suggestions to work around this (I'm considering saving all data to the fusion document as a dictionary with references to the setup IDs but that is a pretty inelegant solution.)

 

Thanks

Tags (3)
3 REPLIES 3
Message 2 of 4
BrianEkins
in reply to: allan4EEKW

I see the same problem. I've ensured a bug was filed; hopefully, it will be fixed soon.

---------------------------------------------------------------
Brian Ekins
Inventor and Fusion 360 API Expert
Website/Blog: https://EkinsSolutions.com
Message 3 of 4
kandennti
in reply to: allan4EEKW

Message 4 of 4
allan4EEKW
in reply to: kandennti

Good idea. This should work in the meantime but the fact that the notes are user-editable could present problems in the future.

 

Thanks for the suggestion.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums