Revision control app macro (release)

Hmm. One common revision for file to handle saving/restoring to/from repository. And then “subrevisions” for configurations and when one of those change, also the common revision changes? What am I missing, seems too simple?

Configurations are a sticky issue for revisions. For us they can represent a family of parts each with their own part number. But we can also have some that are for reference in a drawing. The sheet metal flat is a good example. So do you revision those as well? Today we revise all of them together so they are always the same letter.

Good point. I think the issue is that there is no distinction between the two in SW. It should be two separate things - physical products, or an alternative representations of a physical product.

I think I had a really old enhancement idea I submitted to have the ability to define different configuration types with different settings (Part number, reference use only, etc.) I think we got the derived configurations that kind of did some of that but not fully.

Today we somewhat handle it with a custom property editor that looks at configuration names for certain suffixes that we have standardized. The configuration name starts with the part number, then adds a suffix if needed for different cases.
image.png

That is a neat workaround. I might actually borrow the idea for my projects too. But as far as revisions go, I still don’t know of any non-messy solution…

Still think this would work:
One common revision for file to handle saving/restoring to/from repository. And then “subrevisions” for configurations and when one of those change, also the common revision changes.

This looks great. I work for a small company as the sole engineer and we don’t have a PDM currently so I think this will be hugely helpful as I try to bring order to revision control.

I downloaded V3 first and can’t get it to run. I tried debugging and got a compile error “Sub or function not defined” and it highlighted “SetAppEnabling” on the MainForm.

I tried the other versions to see if they would work and both of them seemed to do fine.

Thanks in advanced!

In my new job we will definitively implement this tool, with the options you provided in v3 we can configure it just like I need.
But I cannot get the “Restore” function to work, I get this message:
2024-06-13_024820-Microsoft Visual Basic for Applications - Version_control_app [running].png
I run the macro from a button and the method called is “core.main”.

laukejas if you have a chance to look into this I would really appreciate!

Hi Marc, sorry for the delay. I am not sure what that error is about, I haven’t seen it before. Can you click on “Aide” when that error appears, and show me what the application does then? Maybe make a video of the whole thing? Does this happen with any SW document? Please send this as PM, we will figure it out there.

Hi Joshua, same thing - please make a video and send it to me as PM. Macros are difficult to debug from another computer :slight_smile:

I don’t know what is happening but the DM I wrote is still in my “Outbox” and I can’t get it out…

Here it is:

Hi and thanks a lot for the time you put into this!
I join a video capture of what happens when I try to restore a previous version.
Enregistrement 2024-07-16 091707.mp4
When using the previewing function it works fine.

I made some changes so we can use our workflow, but I don’t think I changed anything that would would have break this part of the macro.

Thanks!

-Marc

Hi, it’s not your fault: the problem is that the button invokes the Core.Restore function, which doesn’t exist. The right function is Core.Replace…it’s a small typo on the original file…

That’s it!! It works!!

Thanks a lot, this tool will be so useful!

You’re welcome, it’s nothing! I’m also using this very useful macro (thanks so much @Laukejas!)…I’m also making some useful changes to the work system used in my office…as soon as I finish them I’ll post them here, in case they help others!

Hi guys, sorry for the delay, I was neck-deep in other work. I fixed all of the issues that were reported so far. That includes mgibeault , JoshuaDeeMan and Kn1ght. I didn’t have a chance to test it very thoroughly, so if I made any new bugs, let me know, I should be able to fix them fast now. Attaching the V4 to this post.

Release V4

Bug fixes:
-Sometimes the UI would be greyed out when launched.
-It was impossible to increase the version past 10.
-Error due to missing (depreciated) SetAppEnabling function.
-Error when calling Restore function.


It appears that this macro has gotten a lot more attention than I expected, but I struggle to find the time to maintain it properly. I wanted to post it to Github so that others could maintain/improve it as well, (for example, PaoloG said you wanted to add some new features), making it a community project, but I don’t know how to connect SW VBA editor to Github, it does not seem to support any kind of version control, and the .swp files seem to be obfuscated, making it impossible to merge changes via Git command line. Does anyone know a way around it?

Otherwise, I could convert it to an add-in, which is fully compatible with Github via Visual Studio, but it would hurt the ease of deployment and use for the users. What do you guys think would be the best solution here?

The method I’ve seen is to just do a File => Export File and then upload all of the .bas files. You can do this for the forms too and it will spit out 2 files. One for the code and one for the form design but the document for the form design is still in a serialized/unreadable format.

I look forward to check that, I use your macro everyday!
I made some changes so it was easier to integrate to our workflow. So my preference is to continue sharing macros here, we can integrate your changes without loosing our work. But then, I know nothing of software development and what is possible/easier.

I tried it, but it appears that this has to be done for every class file in the macro? There are like 10 in mine… Not very convenient. But still, it’s better than nothing, thank you. Though I hope there is an easier way :laughing:

Great to hear that! Okay, feel free to share it here, but let me know what has been changed exactly, so I can merge your improvements into the main macro.

It’s mostly changing some constants and some terminology.
For example we use Phase / Revision instead of Branch / Version

While updating my version something weird grumph happened.
Both versions (my v3 and the new v4) were opened in the Macro Editor and I was comparing the modules, updating what needed to be.
Now, when I open my version everything has been overwritten! My changes are aren’t there!
When I open backup files I made this morning, they too are “reset” and don’t have my edits o[
What’s up???

Is it a problem with the Macro Editor?
When I run the macro from SW it runs with my modifications…