spettitt Posted June 21 Share Posted June 21 Has anyone scripted the process of adding a new revision to a given sheet? I can GetRField of revision numbers fine, and I can SetRField for any 'normal' fields, but I'm not sure how revisions work given that it retains the history of previous revisions and their data. I know it's a hidden record field for the revision data, but I don't know how to add a 'new' revision on top of the entries that are there. Thanks Quote Link to comment
Pat Stanford Posted June 21 Share Posted June 21 I THINK that each revision is a separate record. It looks like when a new is made (or before it is made probably), each of the existing records name has the extension increased by one, and the newest record that is created has an extension of 1. Not at all certain that there is not more going on under the hood that would make this more complicated. If you create a Worksheet Database with a Criteria of Object Type is Title Block Border, then you can see all the record attached. When I have two revisions, I get: Revision Data-1 Revision Data-2 When I add a third Revision, it is the one titled Revision Data-1 that holds the most current data. Ask again if you need more help. 2 Quote Link to comment
spettitt Posted June 22 Author Share Posted June 22 Thanks Pat. So it looks like I need a script that counts records that start with 'Revision', rename them all +1 and then store my new data as -1. I will give it a go! Quote Link to comment
Pat Stanford Posted June 22 Share Posted June 22 Please let us know if that works. My gut tells me that may not be enough and that there is something else happening as well. But it is certainly worth the try. Quote Link to comment
Vectorworks, Inc Employee Nikolay Zhelyazkov Posted June 24 Vectorworks, Inc Employee Share Posted June 24 On 6/22/2024 at 9:27 PM, Pat Stanford said: Please let us know if that works. My gut tells me that may not be enough and that there is something else happening as well. But it is certainly worth the try. - Yup, there is more happening in the background. 1) We do not always create new record. If the title block does not use all the existing revision data records it makes use of them first and only if it uses all then we create a new record. 2) @Pat Stanford is right about the order - Revision Data-1 is the newest revision. 3) We are also doing some changes to the Revision Data record (without index) to support reverse translation with older versions where we had only 1 record for revisions. So adding new revisions from script and not from the UI might cause some issues, just FYI to be aware. Best Regards, Nikolay Zhelyazkov 2 Quote Link to comment
spettitt Posted June 27 Author Share Posted June 27 On 6/24/2024 at 7:52 AM, Nikolay Zhelyazkov said: - Yup, there is more happening in the background. 1) We do not always create new record. If the title block does not use all the existing revision data records it makes use of them first and only if it uses all then we create a new record. 2) @Pat Stanford is right about the order - Revision Data-1 is the newest revision. 3) We are also doing some changes to the Revision Data record (without index) to support reverse translation with older versions where we had only 1 record for revisions. So adding new revisions from script and not from the UI might cause some issues, just FYI to be aware. Best Regards, Nikolay Zhelyazkov Thanks Nikolay - sorry for the slow response, busy week. I think #1 would be possible to manage in a script now that I know, but #3 might introduce some unknown. It's a relatively low priority efficiency script compared to others, so I might put this one on the backburner unless someone starts really asking for it, in which case I'll proceed in context of the above. Thanks! Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.