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

Store Python variables in document

jaco.waes
Contributor

Store Python variables in document

jaco.waes
Contributor
Contributor

I have created an add-in using the python api that builds a model from a json file with input parameters that i paste in a palette textarea.

 

What would be the best way to store this json string in my document / component ?

 

The comment field of a user parameter comes to mind ... but that is quite a dirty hack.

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

kandennti
Mentor
Mentor
Accepted solution

Hi @jaco.waes -San.

 

Many objects such as Document and Component implement the attributes property, which is suitable for recording arbitrary data.

https://help.autodesk.com/view/fusion360/ENU/?guid=GUID-387291C7-F61E-4DDE-B1EB-0CD9D875DA21 

This is not visible to the user.

 

The sample script "SpurGear" uses the attributes property to record dialog input information, which may be helpful.

1.png

2 Likes

jaco.waes
Contributor
Contributor

Thanks. Exactly what i wanted.

1 Like