Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.

CustomNamedValues vs Attributes - which to use, when and why?

mcd8604
Enthusiast

CustomNamedValues vs Attributes - which to use, when and why?

mcd8604
Enthusiast
Enthusiast

If I need to save data relevant to the settings of a persisted CustomFeature instance, what are the reasons for saving using CustomNamedValues instead of Attributes? The two seem virtually the same, though I can see that Attributes does allow for grouping which can be convenient. Are there differences in storage capacity or retrieval performance? Do they use distinct class or data definitions under the hood or the similar underlying architecture?

 

Thanks in advance,

 

Mike

0 Likes
Reply
Accepted solutions (1)
325 Views
2 Replies
Replies (2)

BrianEkins
Mentor
Mentor
Accepted solution

For saving settings related to a custom feature you'll always want to use CustomNamedValues.  There are a few reasons for this.  First, internally they are simpler than attributes. 

 

Second, their lifetime is associated with the feature.  This isn't true with attributes.  Even though you can access attributes from the entity they are associated with, that connection is loose.  If you delete the entity, the attribute will still exist.  The reason for this behavior is there are some entities that can be removed from the model but may come back in the future.  When it comes back any associated attributes will re-attach themselves.  An example of this is if you attach an attribute to an edge and then fillet that edge. The edge no longer exists in the model but that attribute does. The edge can come back by suppressing or deleting the fillet feature.

 

Third, I think CustomNamedValues are simpler and easier to use than attributes.

---------------------------------------------------------------
Brian Ekins
Inventor and Fusion 360 API Expert
Website/Blog: https://EkinsSolutions.com
1 Like

mcd8604
Enthusiast
Enthusiast

Thank you for the insight, this is very helpful! I've been working with CustomNamedValues and they're working out great.

0 Likes