What’s the diff?

One of the required tools in a programmer’s toolbox is a tool for comparing files. File comparison utilities have come a long way since the original Unix diff command, but this genre of utilities is still referred to as diff tools. For Windows, I use an open source diff utility called WinMerge. WinMerge includes a shell extension that makes it easy to use from within Windows Explorer.

The thing about diff tools is that they can be re-purposed and used for many tasks that have nothing to do with programming. For example, I use WinMerge to easily and quickly compare AutoCAD EULAs and other legal document revisions. I also use WinMerge to preview all changes before applying an upgrade to software like WordPress or Joomla on my web server. In both cases, I can quickly see exactly what changed.

The power of a diff tool is impressive in its own right, but it’s true power borders on amazing when using it as a merge tool to reconcile multiple simultaneous changes to the same files. In programming, reconciling and merging simultaneous revisions allows multiple programmers to work in parallel, thereby reducing management overhead and eliminating the inherent inefficiency of a serial workflow. I think that the principles and even the tools could just as well be applied to any collaborative project such as designing an airplane or building a skyscraper.

Most modern diff tools provide an easy to use GUI, and they do a lot more than just compare files. Even if you’re not a programmer, you should have a diff tool in your toolbox.

Windows offline files

Do you use the Windows offline files feature? I asked this question of some IT/CAD administrator types at Autodesk University last week, and was surprised to find that most didn’t even know what it was. In fact, of the dozen or so people I asked, only one actually used the feature.

There are enterprise solutions that perform similar functions (and cost a lot more), so some of you may not have much need for the feature that has been included in the box since Windows 2000, but I’ll bet that a lot of you would use it if you knew why you needed it.

If you ever need to access remote files from a local network or beyond, you can benefit from the offline files feature. In it’s simplest form, the feature allows you to continue accessing offline files when your network connection is slow or unavailable. It does this by caching copies of your files locally, and automatically keeping the remote and local copies synchronized in the background. If your data is on the cloud, offline files are your shelter from the storm.

For example, it’s common for AutoCAD installations to access configuration files stored on a network server shared by everyone in the organization. If these files are made available offline, the user can continue working on local drawing files without interruption even when the network is completely offline. In fact, if the network is slow or inaccessible for any reason, using offline files will allow the user to continue working as if the network was still perfectly functional.

The UI for offline files has been made very simple (right-click on a remote file in Explorer and select ‘Always available offline’), but there is more power and potential optimization under the hood of this feature. If you’d like to get technical, this TechNet article gives you a taste of the nitty gritty details.

So, do you already use offline files? If so, and especially if you also use RoboCopy, I’d like to hear from you. I use the offline files feature all the time, and I’ve developed a command line utility called RoboCache to manage offline files in Windows Vista and later. I’m looking for a few people to test the utility.

[Update: RoboCache has now been released.]

Disable AutoCAD InfoCenter

Over the years, I and others have provided instructions for turning off the AutoCAD InfoCenter (or Communication Center in older versions). The instructions are different depending on the AutoCAD version. To make things simple, I decided to roll them all up into a single one-size-fits-all MSI file that disables InfoCenter for any and all versions of AutoCAD  or AutoCAD LT in one fell swoop.

The AcadInfoCenterOff.msi file on the ManuSoft Freebies page contains a custom action that disables InfoCenter during installation. Uninstall restores all previous settings. No actual files are installed, as all changes are made in the registry. Packaging the custom action into an MSI is just a convenient way to ensure that you can uninstall in the future from Windows Control Panel even long after the MSI is lost or forgotten.

Why would you want to disable the InfoCenter? Faster startup, for one. Fewer crashes  and lockups, for another. This feature of AutoCAD actually starts an invisible background task that runs as a separate process (named either WSCommCntr1.exe or WSCommCntr2.exe), which establishes inter-process communication with the running AutoCAD. This type of inter-process communication channel is notoriously unreliable, and it’s not unusual to see the background task orphaned in memory after AutoCAD closes in an unusual way, sometimes consuming a lot of CPU cycles and sometimes preventing an AutoCAD restart until it is forcibly ended.

Visual Studio 2010 Native Multi-Targeting

I was hoping that Microsoft would address the need to target earlier versions of Visual Studio within the Visual Studio 2010 IDE, but since they decided to punt, I tackled the problem myself. I’ve released my solution as an open source project named Daffodil for Visual Studio.

With Daffodil installed on your system along with earlier versions of Visual Studio, you can use the new native multi-targeting feature in Visual Studio 2010 to target those earlier versions. This makes it possible to use Visual Studio 2010 for building ObjectARX projects, for example. Daffodil performs essentially the same function that my VC Build Hook utility did in Visual Studio 2008 and 2005.


James Maeding of Hunsaker & Associates contacted me recently about an irritating problem that his users have with the AECOPEN command in Land Desktop. The AECOPEN command replaces the core AutoCAD OPEN command in AEC verticals. The problem they have is that AECOPEN displays an initial project dialog that requires users to press a [Browse] button to open the file browser dialog. Since they want to browse for a file every time they use the AECOPEN command, James wondered if I could create some code to automatically “press” the Browse button every time the AECOPEN command is issued.

I whipped up a little utility for AutoCAD 2007-2009 based products to do what James wanted, and it is now available on my freebies page as AecAutoOpen.zip. When the ARX module is loaded, AECOPEN behaves as if the user had immediately pressed the [Browse] button on the project dialog. If the [Ctrl] key is pressed, AECOPEN reverts to its original behavior.

Why not just use the built in OPEN command instead? The AECOPEN command has some important side effects, according to James.