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: 

Persistent (across sessions) object ids

4 REPLIES 4
SOLVED
Reply
Message 1 of 5
quality5B59E
263 Views, 4 Replies

Persistent (across sessions) object ids

In my addin I would like the user to be able to select curves, points etc and then the addin creates a little program.  I would then like to save the program into a file (or preferably into the fusion document itself as an attribute perhaps).

 

The main problem is that I need some sort of identifier associated with the selected entities that persists across sessions.  When the file is opened again in the future and the addin starts up, I would like to recreate the program and to do so I need to find the entities the user selected previously.

 

There does not seem to be a way to name SketchCurves so I can find them again and there does not seem to be a persistent uniqueID I could use instead?

 

One great method might be to change Fusion so that *all* attributes (even those associated with entities) get saved to the fusion document and recreated when the document is opened again.  It would be easy then to search through the design and entity attributes and recreate my program!  

 

Addins could save their configurations to design level attributes too ...

 

Persistent unique IDs would do the job too albeit with less kewl factor?  Maybe the Base class has a uniqueID property that is persistent across sessions?

 

Thanks!

4 REPLIES 4
Message 2 of 5
BrianEkins
in reply to: quality5B59E

What you can do today is to add an attribute to the entity you want to find later.  You're essentially using attributes as a way to name an entity.  Attributes also have the advantage that you can query for them instead of having to search every entity to see if it has an attribute you're looking for.

---------------------------------------------------------------
Brian Ekins
Inventor and Fusion 360 API Expert
Website/Blog: https://EkinsSolutions.com
Message 3 of 5
quality5B59E
in reply to: BrianEkins

Do attributes get saved into the fusion document across sessions?  In otherwords, if I save my design and exit from fusion and another day start fusion again and open the document, the attributes are still there?

 

If so, that’s great!  The doc doesn’t mention that they persist!

 Thanks!

Message 4 of 5
BrianEkins
in reply to: quality5B59E

Yes, they certainly persist.  They would be fairly useless otherwise. 

---------------------------------------------------------------
Brian Ekins
Inventor and Fusion 360 API Expert
Website/Blog: https://EkinsSolutions.com
Message 5 of 5
quality5B59E
in reply to: BrianEkins

Great! Thanks!

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

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report