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

Saving Metadata in Document File without changing DbRevisionId or RevisionId

Morning,

 

Last week I posted ... "We are working on a project to generate inventor documents  from master "templates" parametrically (similar to iparts) using both iLogic and the api. I am looking for some technique/method to fully qualify if "any edits" have been made to the document after it was generated."

 

At that time I thinking of trying to calc a checksum and looking for some method to embedded the checksum in the doc file. Adam Nagy suggested using the document RevisionId and DatabaseRevisionId to qualify if any edits had been made. Turns ou that works quite nicely.

 

However I am still evaluationg the best method to embed these values (and also a larger serailized config file) into the file.

 

Did find several articles related to "Save extra data in Inventor file" by Xiaodong Liang on http://adndevblog.typepad.com/manufacturing/2013/03/save-extra-data-in-inventor-file-1.html

 

He details three methods available.. 1. iProperties 2. Attribute 3. IStorage & IStream

 

Did a bit of testing trying each of these techniques to save my metadata.

 

In my test it seems that using Attributes or iStorage requires a full document save.. which changes the DatabaseRevisionId and RevisionId. Which for my purposes is not ideal. 

 

However did find when using the Custom Property Set and Apprentice FlushToFile to push the properties to the document file the DbRevisionId and RevisionId are not changed.  For my purpsose this seems ideal.. but  would like to confirm my assumptions before pressing on.

 

Could anyone confirm that if using Apprentiice PropertySet.FlushToFile with a Custom PropertySet will "never"change the DbRevisionId and RevisionId of the document?

 

My second questions is "how much data can each property in the property set contain"?

 

Reason for second question is I am considering using this propertyset to also store a larger set of data.. serialized configuration data for the app. Did a quick test and  a singe property appearred to accept 100k of data.. but 1 mb it fell over. Possibly I can break the serialize string into chunks to store it in the property sets.

 

I would think that iStorage/Attributes would be really designed to store larger sets of data... But if Custom PropertySets don't effect RevisionId then I think it would be my first choice.

 

 

Thanks