Author Topic: Using version control for AutoCAD projects  (Read 19541 times)

0 Members and 1 Guest are viewing this topic.

BlackBox

  • King Gator
  • Posts: 3770
Re: Using version control for AutoCAD projects
« Reply #15 on: May 08, 2014, 11:12:00 AM »
... take for example a two file set up (the simplest example): I have to be disciplined to work on one task at time and stage my commit so that both are committed.
~E.G.: The task is to make a change (in file1) and make a new PDF (of file2 which refs file1).
If there isn't a need to save file2 for just plotting all is good; make change, plot and commit file1.
otherwise I need to stay on track and work on both files (save them) and make sure they are both committed at the same time.

If you were so inclined....

You could write a fairly simple event-driven .NET plug-in which would allow you to instead simply open file2 and plot (if you're not already using Autopublish?), which would then programmatically iterate each loaded XREF, to build a list of files to verify, then weed said list for only those that are not 'current', commit/reload them as required (assuming that GIT allows this to be done from within the plug-in's scope?), and then allow for the Command to proceed.

... Or... If you prefer baby steps, simply determine if any references are not 'current', and then Veto() the Command altogether... With an appropriately annoying message to user, like when attempting to create Data References in C3D without first saving the drawing (which reminds me to finish my plug-in for that annoying sum-b!tch). :-D
« Last Edit: May 08, 2014, 11:15:26 AM by BlackBox »
"How we think determines what we do, and what we do determines what we get."

JohnK

  • Administrator
  • Seagull
  • Posts: 10605
Re: Using version control for AutoCAD projects
« Reply #16 on: May 08, 2014, 11:25:25 AM »
... take for example a two file set up (the simplest example): I have to be disciplined to work on one task at time and stage my commit so that both are committed.
~E.G.: The task is to make a change (in file1) and make a new PDF (of file2 which refs file1).
If there isn't a need to save file2 for just plotting all is good; make change, plot and commit file1.
otherwise I need to stay on track and work on both files (save them) and make sure they are both committed at the same time.

If you were so inclined....

You could write a fairly simple event-driven .NET plug-in which would allow you to instead simply open file2 and plot (if you're not already using Autopublish?), which would then programmatically iterate each loaded XREF, to build a list of files to verify, then weed said list for only those that are not 'current', commit/reload them as required (assuming that GIT allows this to be done from within the plug-in's scope?), and then allow for the Command to proceed.

... Or... If you prefer baby steps, simply determine if any references are not 'current', and then Veto() the Command altogether... With an appropriately annoying message to user, like when attempting to create Data References in C3D without first saving the drawing (which reminds me to finish my plug-in for that annoying sum-b!tch). :-D

A task based application? So the user defines tasks (s)he need to preform and the app determine if (s)he has to open/close/save a file or another file? That sounds very complicated.
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

BlackBox

  • King Gator
  • Posts: 3770
Re: Using version control for AutoCAD projects
« Reply #17 on: May 08, 2014, 11:36:32 AM »
... take for example a two file set up (the simplest example): I have to be disciplined to work on one task at time and stage my commit so that both are committed.
~E.G.: The task is to make a change (in file1) and make a new PDF (of file2 which refs file1).
If there isn't a need to save file2 for just plotting all is good; make change, plot and commit file1.
otherwise I need to stay on track and work on both files (save them) and make sure they are both committed at the same time.

If you were so inclined....

You could write a fairly simple event-driven .NET plug-in which would allow you to instead simply open file2 and plot (if you're not already using Autopublish?), which would then programmatically iterate each loaded XREF, to build a list of files to verify, then weed said list for only those that are not 'current', commit/reload them as required (assuming that GIT allows this to be done from within the plug-in's scope?), and then allow for the Command to proceed.

... Or... If you prefer baby steps, simply determine if any references are not 'current', and then Veto() the Command altogether... With an appropriately annoying message to user, like when attempting to create Data References in C3D without first saving the drawing (which reminds me to finish my plug-in for that annoying sum-b!tch). :-D

A task based application? So the user defines tasks (s)he need to preform and the app determine if (s)he has to open/close/save a file or another file? That sounds very complicated.

I cannot speak to how it sounds....

Only that accidental failure to manually perform all of the same required tasks will yield incorrect PDF, and potentially unhappy client(s), which results in additional manual time, re-prints, supplementary emails to provide corrected document(s), etc.

Maybe you try both methodologies, and see which one is simpler to maintain consistency in daily production, maybe you don't; your call. :-)

Cheers
"How we think determines what we do, and what we do determines what we get."

JohnK

  • Administrator
  • Seagull
  • Posts: 10605
Re: Using version control for AutoCAD projects
« Reply #18 on: May 08, 2014, 12:16:13 PM »
... take for example a two file set up (the simplest example): I have to be disciplined to work on one task at time and stage my commit so that both are committed.
~E.G.: The task is to make a change (in file1) and make a new PDF (of file2 which refs file1).
If there isn't a need to save file2 for just plotting all is good; make change, plot and commit file1.
otherwise I need to stay on track and work on both files (save them) and make sure they are both committed at the same time.

If you were so inclined....

You could write a fairly simple event-driven .NET plug-in which would allow you to instead simply open file2 and plot (if you're not already using Autopublish?), which would then programmatically iterate each loaded XREF, to build a list of files to verify, then weed said list for only those that are not 'current', commit/reload them as required (assuming that GIT allows this to be done from within the plug-in's scope?), and then allow for the Command to proceed.

... Or... If you prefer baby steps, simply determine if any references are not 'current', and then Veto() the Command altogether... With an appropriately annoying message to user, like when attempting to create Data References in C3D without first saving the drawing (which reminds me to finish my plug-in for that annoying sum-b!tch). :-D

A task based application? So the user defines tasks (s)he need to preform and the app determine if (s)he has to open/close/save a file or another file? That sounds very complicated.

I cannot speak to how it sounds....

Only that accidental failure to manually perform all of the same required tasks will yield incorrect PDF, and potentially unhappy client(s), which results in additional manual time, re-prints, supplementary emails to provide corrected document(s), etc.

Maybe you try both methodologies, and see which one is simpler to maintain consistency in daily production, maybe you don't; your call. :-)

Cheers

Version control isn't stopping you from making a PDF…Nor would it lock down or revert a file. The worst that can happen is that a user forgets to PUSH to the server wherein another user wouldn't get the latest. So, an automatic pull/push would have to be almost automatic.

As for the constant pinging on the network (data usage/network speed) issue that this discussion could morph into now:
GIT data structures (the index and blobs) and how it's transmitted is a bit beyond me and this level of brainstorming so I think I will try to focus on finding or creating an API or creating some C++ apps that simplify the workflow a little more instead. I still think a few exe's that do some heavy lifting written in C++ which a simple Lisp calls would be a good test (command line workflow for now--the GUI can be a palette or a button or two).
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

Greg B

  • Seagull
  • Posts: 12417
  • Tell me a Joke!
Re: Using version control for AutoCAD projects
« Reply #19 on: May 08, 2014, 12:36:19 PM »
So, an automatic pull/push would have to be almost automatic.

 :?

BlackBox

  • King Gator
  • Posts: 3770
Re: Using version control for AutoCAD projects
« Reply #20 on: May 08, 2014, 12:46:19 PM »
Version control isn't stopping you from making a PDF…Nor would it lock down or revert a file. The worst that can happen is that a user forgets to PUSH to the server wherein another user wouldn't get the latest.

No worries; I do not personally use version control much (I need to start), and I may have focused too much on the sync between local & network, and less on the sub-versioning per-se.



So, an automatic pull/push would have to be almost automatic.

Never thought about it like that, but it certainly makes sense to do it that way. :-P



As for the constant pinging on the network (data usage/network speed) issue that this discussion could morph into now:
GIT data structures (the index and blobs) and how it's transmitted is a bit beyond me and this level of brainstorming....

That is definitely an area outside of my expertise, and gladly defer to your, or others input.



... so I think I will try to focus on finding or creating an API or creating some C++ apps that simplify the workflow a little more instead. I still think a few exe's that do some heavy lifting written in C++ which a simple Lisp calls would be a good test (command line workflow for now--the GUI can be a palette or a button or two).

I forgot that you prefer C++; my suggestion for the .NET (ObjectARX?) plug-in could easily be ported from being event-drive, to CommandMethod, or LispFunction Method accordingly, and then use built-in CUI functionality to call same (to keep it simple)... If interested, when you get to the AutoCAD side, I'll gladly share a working example of what I initially suggested.

Cheers
"How we think determines what we do, and what we do determines what we get."

JohnK

  • Administrator
  • Seagull
  • Posts: 10605
Re: Using version control for AutoCAD projects
« Reply #21 on: May 08, 2014, 01:30:45 PM »
No worries; I do not personally use version control much (I need to start), and I may have focused too much on the sync between local & network, and less on the sub-versioning per-se.



I forgot that you prefer C++; my suggestion for the .NET (ObjectARX?) plug-in could easily be ported from being event-drive, to CommandMethod, or LispFunction Method accordingly, and then use built-in CUI functionality to call same (to keep it simple)... If interested, when you get to the AutoCAD side, I'll gladly share a working example of what I initially suggested.

Cheers

You don't? …at all?! I can't imagine coding without it. Just thinking about the whole USB stick/Work PC/Home PC situation without SCM gives me a headache. Now that I have a server set up again things are/can be different but for a long time I would just use the USB stick as the central repro and push/pull from that on each PC. Made the whole syncing situation easier.

You owe it to yourself to try a SCM! NOW!! :) Go and check out Bazzar (Very user friendly). When you outgrow it or want something a little bigger (may never happen), try Mercurial. All of these SCMs (Bazzar, Mercurial, Git, etc.) are just different flavors of the same thing but they each have their quirks. Like, for example, Mercurial has a nasty bug when working on *nix and Windows. Bazzar has a nasty little quirk working on windows (I don't remember what it was). and Git isn't a windows native tool so it can be a bit buggy on Windows (but IMO a little more stable on all platforms if you just use the command line).

Thanks, I will take you up on that offer. I will read that C# book I downloaded and start my .net education. When I get comfortable enough to start coding I think we'll use Bazzar for the SCM tool (the whole push/pull situation I discussed earlier is a bit different in BZR and will be better for our tool).
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

BlackBox

  • King Gator
  • Posts: 3770
Re: Using version control for AutoCAD projects
« Reply #22 on: May 08, 2014, 02:05:38 PM »

You don't? …at all?! I can't imagine coding without it. Just thinking about the whole USB stick/Work PC/Home PC situation without SCM gives me a headache. Now that I have a server set up again things are/can be different but for a long time I would just use the USB stick as the central repro and push/pull from that on each PC. Made the whole syncing situation easier.

You owe it to yourself to try a SCM! NOW!! :) Go and check out Bazzar (Very user friendly). When you outgrow it or want something a little bigger (may never happen), try Mercurial. All of these SCMs (Bazzar, Mercurial, Git, etc.) are just different flavors of the same thing but they each have their quirks. Like, for example, Mercurial has a nasty bug when working on *nix and Windows. Bazzar has a nasty little quirk working on windows (I don't remember what it was). and Git isn't a windows native tool so it can be a bit buggy on Windows (but IMO a little more stable on all platforms if you just use the command line).

Perhaps my earlier statement was incomplete.

A while back, I took on a short one-year developer consultant position with an out of state AutoCAD development firm, where I worked nights & weekends from home, using TortoiseSVN (TSVN), but I've never used anything like Git, Bazaar, Mercurial, etc before; development has historically been just a fun hobby.

More recently, I am fortunate to have an opportunity to work with a prominent Civil 3D developer also using TSVN. Regretfully, due to an unexpected (but very much welcomed) change in employment, I have done little if anything with such an opportunity.

I've now been with my new employer for more than 90 days, and the dust is starting to settle... I've upgraded our workstations, the new server was recently delivered, and the implementation team could be here as soon as next week. I'm wrapping up final review for new print firm lease proposals, and am getting ready to start tackling our Civil 3D CAD Standards. After the server migrations are complete (going from Server 2003--> Server 2013), and I've upgraded all workstations from WinXP/7 to Win8.1, I can _finally_ get back into my development initiatives (and take advantage of that Civil 3D development opportunity!). :-)




Thanks, I will take you up on that offer. I will read that C# book I downloaded and start my .net education. When I get comfortable enough to start coding I think we'll use Bazzar for the SCM tool (the whole push/pull situation I discussed earlier is a bit different in BZR and will be better for our tool).

Here's an old post that provides a C#.NET plug-in which is very similar to how I envisioned my initial suggestion here, however, it could easily be changed from being event-driven to being accessible to CommandMethod, and LispFunction Method as desired (just have to test for Application context, etc. methinks).

In any event, this plug-in implements a simple event handler within each Document opened, that hooks the CommandWillStart event, filtering for *CLOSE, or QUIT Commands, and contextually prompts user via TaskDialog to offer pseudo-named 'Warn Before Exit' functionality. There's also an Autoloader .bundle attached if interested. I ended up working with user offline to help provide something a bit more specific to their working environment, but not too shabby for +/- 100 lines of C# I guess.

As for reading material... It's probably out-dated now, but I enjoyed Andrew Troelsen's Pro C# 2010 and the .NET 4.0 Platform... As much as one can enjoy a +/- 1500 page book on development concepts, and design patterns... Ha! :-D

Cheers
"How we think determines what we do, and what we do determines what we get."

JohnK

  • Administrator
  • Seagull
  • Posts: 10605
Re: Using version control for AutoCAD projects
« Reply #23 on: May 08, 2014, 02:20:04 PM »
Congrats to you and your new position and all the achievements! That's very nice to hear (that someone is doing good and enjoying what they do these days).

I will give it a look. Thanks for the recommendation.
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

Bashworth

  • Guest
Re: Using version control for AutoCAD projects
« Reply #24 on: May 08, 2014, 02:42:36 PM »
While it may not be exactly what you're looking for, I've become quite happy with Google Drive as a Cloud based solution.   

Look at the AutoCAD WS plug in for Drive. It offers version snapshots of drawings, and allows access control.  In addition to making drawings viewable/downloadable to any computer or tablet/phone with the app.

https://chrome.google.com/webstore/detail/autocad-360/dcjeclnkejmbepoibfnamioojinoopln

BlackBox

  • King Gator
  • Posts: 3770
Re: Using version control for AutoCAD projects
« Reply #25 on: May 08, 2014, 03:09:10 PM »
Congrats to you and your new position and all the achievements! That's very nice to hear (that someone is doing good and enjoying what they do these days).

Thank you; I did not mean to be insensitive to your current situation... Where I am now is the result of many, many years of personal and professional hardship.

As a man much wiser than I once said, "This too shall pass." :-)



I will give it a look. Thanks for the recommendation.

You're welcome; please let us know how it goes when you get to that stage.

Cheers
"How we think determines what we do, and what we do determines what we get."

JohnK

  • Administrator
  • Seagull
  • Posts: 10605
Re: Using version control for AutoCAD projects
« Reply #26 on: May 08, 2014, 04:43:25 PM »
No problem BlackBox.

I will.

I use google drive too CSO. Currently Im trying out outlook.com but I like google better. I just haven't had the desire to switch back right now.
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

Bashworth

  • Guest
Re: Using version control for AutoCAD projects
« Reply #27 on: May 08, 2014, 05:18:04 PM »
Calling it google drive is kind of a misnomer I'm realizing.  What they've done is basically add AutoCAD 360 in as a Chrome App.

MickD

  • King Gator
  • Posts: 3619
  • (x-in)->[process]->(y-out) ... simples!
Re: Using version control for AutoCAD projects
« Reply #28 on: May 08, 2014, 06:52:59 PM »
Managing 'checkout' is the biggest issue as someone earlier mentioned although there are tools to track and merge in changes and 'collisions' where 2 people may be working on the same files but this could be controlled somehow I'm sure.

Here's an example of handling a collision and a good primer for git, there are many ways to use it -
https://www.atlassian.com/git/workflows#!workflow-centralized

For anyone wanting to try a git repo site, Bitbucket is quite good and gives you a few free private repos to work with and has a step by step set up to get you going.
Most others only allow opensource for free. For my acad work I'm using team foundation server and the agile tools, it's quite good and free for up to 5 users I think.
I recommend GitBash as a console tool for working with git on windows.
"Short cuts make long delays,' argued Pippin.”
J.R.R. Tolkien

JohnK

  • Administrator
  • Seagull
  • Posts: 10605
Re: Using version control for AutoCAD projects
« Reply #29 on: May 09, 2014, 09:26:09 AM »
I didn't know bitbucket had free PRIVATE repos. …Just signed up. :)
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org