![Shocked :shock:](./images/smilies/icon_eek.gif)
P.S. I think the issue was the revision sorting algorithm, I rewrote it, but I still want to test it with some of problematic files to ensure I didn't miss something.
I think the root problem will be that the filename doesn't have an underscore. Figuring out where, in all of that code, the filename is selected and fed to the function is a different question.
Here's a file and it's versions from the Repo folder. I don't know why there's no "A.1" version. To be sure it was not a cause to the problem I duplicated A.2 and renamed to A.1 but it changes nothing.laukejas wrote: ↑Tue Nov 05, 2024 2:07 pm Hi guys, sorry for my absence, for some reason I was not getting notifications, and now like 5 of them arrived at onceI am looking into this issue as we speak. If there is no NDA or anything, could you please share at least one file (and it's revision history files) that shows the "subscript out of range" error, or missing revisions in the list? I can't seem to replicate either of these issues. If I had some samples, I could finally nail this down.
P.S. I think the issue was the revision sorting algorithm, I rewrote it, but I still want to test it with some of problematic files to ensure I didn't miss something.
Thank you! I think the issue was indeed the sorting algorithm that I changed from v3 to v4 (if I remember right). I tested your files with updated version, and it seems to work correctly now, but please check yourself to make sure. Attaching the v5_beta. Changes I made, this is from my changelog in progress:mgibeault wrote: ↑Tue Nov 05, 2024 3:55 pm Here's a file and it's versions from the Repo folder. I don't know why there's no "A.1" version. To be sure it was not a cause to the problem I duplicated A.2 and renamed to A.1 but it changes nothing.
When I run the macro on this file, "Phases" and "Revision" change results in the "subscript out of range" error. The drop-down shows nothing.231130-416.zip
Thanks to you!
Thank you, I'll be waiting
Code: Select all
Public Const DEBUG_ENABLED As Boolean = False
Code: Select all
Public Const DEBUG_ENABLED As Boolean = True
Yeah, Tools->Run does not allow you to choose which method to run the macro from... Sometimes the macro "loses" the reference to which method is the default (entry) one, and I honestly don't know how to specify that. I can try to re-create the macro from scratch (copy over the code), maybe that will fix it. But for now, use a macro button, or run the macro from the macro editor by pressing F5 and then choosing the correct entry method (Core.main).mgibeault wrote: ↑Wed Nov 06, 2024 3:32 pm -Nothing happens if I just use "Tools->Macro->Run..." or use the button "Run Macro". The MainForm shows up when I assign the macro to a button. Is it because there's a field for the method (Core.main) that cannot be specified otherwise? I lost a lot of time trying to find why the macro would do nothing as I was testing with a "Run Macro" button.
This is a loop that traverses through all of your files in the repo directory, you probably have quite a lot of them, that is why it appears to get stuck. You can add a breakpoint after the loop and press F5 to run the macro until that breakpoint, it will save you a lot of time.
This is from AdditionalActionsForm:
Thank you for confirming, I thought that was itmgibeault wrote: ↑Thu Nov 07, 2024 9:20 am Well, thanks to you!!!
That's certainly the problem, when I hover over "filename" it shows "231130-450.sldprt". So it's a file that was copied there without the macro.
I can enforce a "do not touch directly" policy to the Repo folder but I cannot guarantee it will be followed in the long term.
Edit: I cleaned-up the Repo folder and it works!!!
For the problem of the "Run macro", don't spend time on this. It's a problem with SolidWorks' implementation.
For editing the macro I copy the text into Notepad++. I can have 2 files side-by-side with synchronized scrolling. And it has VB code highlighting.
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.laukejas wrote: ↑Thu Nov 07, 2024 11:55 am Thank you for confirming, I thought that was itI added a check to disregard such files so you don't have to enforce that policy, but I suspect there is still plenty of ways to break my macro, I didn't include a lot of error checking because of how limited VBA is and how annoying it soon becomes to maintain a project of such complexity in that macro editor. I too sometimes use Notepad++ for refactoring, but still have to copy the code back over to the VBA editor afterwards... Visual Studio is such a relief to work in compared to this. Sad that we can't use it for writing and debugging macros.
Anyway, I will test that macro further for a few more days, maybe do some clean up and further refactoring, and then I will post it here.
No problem
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.
Hey, be careful with such comments, DS might come after me for hurting their sales
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.