Revision control app macro (release)

Very much appreciated, it’s very good work. It makes me doubt it would be really valuable to implement a PDM for our small team, your macro answer so many common problems in a very straightforward way.

No problem :slight_smile: I never expected this little tool to gain so much popularity, after all, it does maybe 1% of what PDM does, if that. But I’m glad you find it so useful. I will post the v5 in just a moment.

If this had been available a few years ago I likely would have never purchased PDM. It appears to do most, if not all, of what our tiny engineering department needs from a PDM.

1 Like

Okay, so after some extensive testing, I think V5 is stable, so here it is.

Release V5

Changes:
-The application will no longer automatically lock Released documents (make them read-only, lock external references and enable freeze bar), but will prompt the user by default. If you prefer to always lock these references (old behavior), or to never lock, edit the value of Constants.LOCK_RELEASED_DOCS_OPTION. As a result of this change, SET_RELEASED_VERSIONS_FREEZEBAR and SET_RELEASED_VERSIONS_LOCK_REFS have been deprecated.
-Additional Actions → “Delete version history” was renamed into “Set new tracking ID”, and the prompt rewritten to make it less confusing. The actual functionality did not change, but it should be clearer what this function does: it starts a new tracking history to the current document starting with revision A.1. Intended usage is when you save a tracked part with SOLIDWORKS Save As, and want to have a separate tracking history for this new file without deleting the old one.
-Renamed some variables, constants and functions.
-Some refactoring.

Bug fixes:
-Rewrote the sorting algorithm, added a few helper functions to Utilities. Should fix the “subscript out of range” issue.
-Added a check for the macro to ignore files in the repo that do not follow the [DocumentId][Version][FileName.SLDPRT] convention. Should now provide a proper error message rather than behaving unpredictably.
-Eliminated the confusing “the key is already associated with this collection” error. It happens when you save a tracked part with SOLIDWORKS Save As, but do not assign a new tracking number. The application will now recognize this, and warn the user.
-Fixed a bug where setting a new document tracking number (former “Delete version history” button) would not update the “Available versions” list, and it would still show the old file versions.

Hopefully I didn’t miss anything serious. But nevertheless, if you find any issues, let me know, and I’ll try to find some time among other projects to fix it :slight_smile: And like I said before, if anyone wants to take on developing this further, feel free, I’m not holding any rights.

Hey, be careful with such comments, DS might come after me for hurting their sales :laughing:

I think it’s because you constructed it with a module that is very easy to personalize and can be made to follow existing workflows.
One could hide a button or two and use it as a simple archiving/backup tool by saving versions into the repository as they go. Or go the opposite way and use the 3 levels of document control you offer, always with the choice of using wording that speaks to your team.

Hi Laukejas,
Can you please re post for download of V5?
I can’t seem to find it in the comments. V5Beta is the last post for download.
Maybe it’s just me
Cheers

1 Like

Of course, here it is. I guess the forum transition messed up quite a lot of attachments…

Version control app V5.swp (590.5 KB)

2 Likes

Thankyou Laukejas

Strange thing is, your original upload simply wasn’t in the flies transferred from CADForum. It’s listed in the database:

+---------------------------------------+-------------------------------------+
| physical_filename                     | real_filename                       |
+---------------------------------------+-------------------------------------+
| 1046_824df479f26d0243a3ce0668e02e07d3 | Revision control app V1.swp         |
| 1046_8f384da42eabf2f7bcccb37d69f8b6fe | Revision control app V2.swp         |
| 1046_4edda4ff55755feaecdcd0b77103a943 | Draw CoV.swp                        |
| 1046_1d8d2cf87ae651d3e92378c4bf502d5d | Version control app V3.swp          |
| 1046_9254edf221b9e67e27d0b24c0ebb5c97 | Set density by infill.swp           |
| 1046_5d1595b15d6291d34b3c5870436872bf | Each body to STL.swp                |
| 1046_d2d273eeb59cdb6e49d877b421f9801b | Draw CoV.swp                        |
| 1046_07f23a2a5b506f833e96067d808e46f5 | Edit Component.swp                  |
| 1046_0ccdd7f968ac9e4389eaf64d7fc8e6ea | Rebuild assembly parts.swp          |
| 1046_06ebd7d1a2076c435d92d8b970e6a7c1 | Modify external references.swp      |
| 1046_de7a7df2666b85f72862439183c513cd | Set image quality for all parts.swp |
| 1046_06bb4016ad1a2df0e83bb76a0fbd0291 | Toggle tangent edge display.swp     |
| 1046_339bae85c1691b869625e4af2e53413c | Version control app V4.swp          |
| 1046_33564712ce9eafe9a3c239edf299b316 | CustomMass.swp                      |
| 1046_fe09cec5149474029ba25ac34527281c | ApplyTemplate.swp                   |
| 1046_473dd3ea6e3de2d20fc5dfde438085ca | Version control app V5_beta.swp     |
| 1046_595b2464d7e0e1aaaaec3418f5aa54e9 | Version control app V5.swp          |
| 1046_5988861d124d770af4c61bac731cf420 | TempBodiesTest.swp                  |
| 1046_b3db7cab51f85c407d42e6b8a8466101 | RandomBodyColor.swp                 |
+---------------------------------------+-------------------------------------+

But the physical file is missing:

[root@buttercup files]# ls -la 1046_*
-rw-rw-rw-. 1 root root   48785 Apr 29 12:53 1046_00f9ff0ab6d5866b81b3c20f8096473b
-rw-rw-rw-. 1 root root  149493 Apr 29 13:22 1046_03af43ca82589f2f121024ed639182ab
-rw-rw-rw-. 1 root root  196073 Apr 29 13:11 1046_064e95c4ae6a3b4bd1aea53eb3b3b80c
-rw-rw-rw-. 1 root root   31324 Apr 29 13:04 1046_0a6b40becd9c560c027d67ee4a0f789e
-rw-rw-rw-. 1 root root   45056 Apr 29 13:07 1046_0ccdd7f968ac9e4389eaf64d7fc8e6ea
-rw-rw-rw-. 1 root root 4843126 Apr 29 13:16 1046_0f8bca812b6029d3b24100a8b3616b40
-rw-rw-rw-. 1 root root 7639739 Apr 29 13:24 1046_194bb3fb5a2181a564e10ed2e771fa12
-rw-rw-rw-. 1 root root    7829 Apr 29 12:59 1046_199175d3fab96566e4a400475490e13b
-rw-rw-rw-. 1 root root  136279 Apr 29 13:18 1046_1cbc5820693d40fbff92be793cddc46d
-rw-rw-rw-. 1 root root  223157 Apr 29 13:04 1046_27f4c6b6a79ea82093145cddf5456e0a
-rw-rw-rw-. 1 root root   12372 Apr 29 13:08 1046_2e544b27936d958ec0f6d296e49bc8cb
-rw-rw-rw-. 1 root root   46592 Apr 29 13:11 1046_33564712ce9eafe9a3c239edf299b316
-rw-rw-rw-. 1 root root  132284 Apr 29 13:18 1046_3f638975d7c944bf6e39d6dba79ad366
-rw-rw-rw-. 1 root root  581145 Apr 29 12:56 1046_42a8d15e916ac6026edffbcc21bf85ac
-rw-rw-rw-. 1 root root   64562 Apr 29 13:16 1046_442f997c07e3aafde5a0c2a2c4cd81ae
-rw-rw-rw-. 1 root root  604672 Apr 29 13:21 1046_473dd3ea6e3de2d20fc5dfde438085ca
-rw-rw-rw-. 1 root root   30208 Apr 29 13:13 1046_5988861d124d770af4c61bac731cf420
-rw-rw-rw-. 1 root root  284935 Apr 29 13:16 1046_5b873cf62b576455e5982074699a95d3
-rw-rw-rw-. 1 root root  133898 Apr 29 12:52 1046_66fdde57874b6442711e778b5f57061f
-rw-rw-rw-. 1 root root   67353 Apr 29 13:03 1046_67ee85fa914502e2b2fa1a5ea260ea7e
-rw-rw-rw-. 1 root root 1110308 Apr 29 13:12 1046_684cc7b02792d492eabfd30b0463f856
-rw-rw-rw-. 1 root root   86160 Apr 29 12:56 1046_69276311ddeee1d4f7ef099a593ee6f7
-rw-rw-rw-. 1 root root   98306 Apr 29 12:59 1046_7286f2852827b8bed2d6932f2ab40a04
-rw-rw-rw-. 1 root root  334317 Apr 29 13:12 1046_78eb55d508be228cf9aa014a59f8c68b
-rw-rw-rw-. 1 root root  339808 Apr 29 13:12 1046_7f089547a35a2fcd6e92f49ed5cd903e
-rw-rw-rw-. 1 root root  210944 Apr 29 13:19 1046_824df479f26d0243a3ce0668e02e07d3
-rw-rw-rw-. 1 root root   73018 Apr 29 12:59 1046_8875a33c894ca1e6b957d5db3ffdf9a4
-rw-rw-rw-. 1 root root  125885 Apr 29 13:00 1046_88fa47f435be602fe79b5c1be07faf96
-rw-rw-rw-. 1 root root  602477 Apr 29 12:53 1046_a46b17feb0b5e97ade1d859eff94a08b
-rw-rw-rw-. 1 root root  534854 Apr 29 13:16 1046_a6225f2ddc1b9789f4723611766000e3
-rw-rw-rw-. 1 root root   11489 Apr 29 12:59 1046_a9be56ce01157ebfcfa42f9777fb205c
-rw-rw-rw-. 1 root root  105680 Apr 29 13:04 1046_b1cf95f3e5d495a59853845d65af18cf
-rw-rw-rw-. 1 root root  199235 Apr 29 13:07 1046_b4b96c53b40d9b48da02de1d90b79356
-rw-rw-rw-. 1 root root  363372 Apr 29 13:12 1046_b8f487c288eb4fc05d652ccc4a0875ca
-rw-rw-rw-. 1 root root 4539780 Apr 29 13:09 1046_ba87fcfbf614f02d2699f6b9b73bea92
-rw-rw-rw-. 1 root root  146770 Apr 29 13:19 1046_c5659e55b3281f49464681550dd82df4
-rw-rw-rw-. 1 root root  369862 Apr 29 13:18 1046_c7853469ed12ef4be8d9398467c74656
-rw-rw-rw-. 1 root root  817138 Apr 29 13:21 1046_d1c0d2a29cba60f43eb90f3133ace52a
-rw-rw-rw-. 1 root root   67030 Apr 29 13:22 1046_d5fe7ec663c31c282038ca453fbc35ae
-rw-rw-rw-. 1 root root 5245632 Apr 29 13:22 1046_d9aeb4a8abace6c502b3e037a499b30a
-rw-rw-rw-. 1 root root  312157 Apr 29 12:53 1046_dc5fad02e33ebe5c5ebdef99be4aa9a3
-rw-rw-rw-. 1 root root  203784 Apr 29 13:05 1046_ed80e0da5d6bf5a6ed721778b98c13da
-rw-rw-rw-. 1 root root  145693 Apr 29 12:53 1046_f87d8ea34b36a8ecc5b1b2144c6cdaac
-rw-rw-rw-. 1 root root   99840 Apr 29 12:58 1046_fe09cec5149474029ba25ac34527281c

Not sure about that… I don’t know much about database transfers. I’m happy to re-upload anything else that’s missing though :slight_smile:

1 Like

Thank you

Hi
We’re still enjoying your macro!

I had an idea for an additional feature that may (or may not?) be not too difficult to implement: The possibility to add a comment when you issue a Branch/Version/State.
I don’t know if it would be most useful to keep the comment for every file version;
Comment_B.3 Comment for this version
Or the field just gets overriden. That would be enough for our use as we can retreive prior versions and read their “comment” property.

Does it make sense?
If it does but you don’t have time to work on this can you point me in the right direction?

Thank you, that is a good idea! I did consider a while ago, but couldn’t decide on how it would be implemented. Having comment custom property field for every revision would quickly bloat up the property manager. Overwriting same field makes sense, because revisions are saved in repo, and each revision can have it’s own comment. The issue is making these comments useful, for example, if you look at the list of revisions in the drop down menu of the macro, it can’t read the comment property values from each file in repo - that would require Document Manager API and the associated license for each user. Otherwise, the only way to access the comment would be to load each revision file in repo, which, even in silent mode, would freeze SW very fast. Maybe it is possible to write the comment in Windows-accessible file attributes, I’ve never tried that, this shouldn’t require Document Manager API to read. Ideas would be welcome.

Another question is, when does the user write the comment? When creating a new revision (for the new revision), or when setting it to Released? Probably the first one, although I often find myself unsure of all the things I’m going to change when I’m starting a new revision, it only becomes clear towards the end. So maybe the second option makes more sense. Or maybe it could be an open textbox in the macro window that can be modified at any time for current revision, and maybe a reminder message if user forgot to write a comment for the current revision when trying to release it or creating a new revision. Not sure.

If you could work out a workflow that makes most sense, I could see if I can find some time to implement it, probably next month at best, I’m currently neck deep in other projects :smiley: