Does Vista really open DWF files?

Not according to the press release. Vista (and .NET 3.0) includes a built-in XPS Viewer (also available for Windows XP SP2 and Windows Server 2003), which will view any XPS format file. Apparently Autodesk plans to add support for output to XPS format in the future, and this output will be called DWFx — a new file format. It’s not clear what the difference will be between DWFx and the output produced using the Microsoft XPS Document Writer that is already available.

I installed the Microsoft XPS Document Writer and XPS Viewer on my Windows XP SP2 machine. Next, I started AutoCAD 2007 and opened “3D House.dwg” from the Sample folder. I then plotted this file to DWF, PDF, and XPS, with the following results:

Plotter Plot Time File Size
DWF6 ePlot.pc3 7 seconds 139 kb
DWG To PDF.pc3 5 seconds 165 kb
Microsoft XPS Document Writer 34 seconds 829 kb

I’m not suggesting that these files all contain the same content, I’m merely suggesting that DWFx/XPS may have some undesirable tradeoffs in practice.

This whole issue about “native Vista support for DWF” may be nothing but smoke and mirrors. There is no guarantee that publishing CAD data in the XPS format will be efficient. So what will happen if users can choose between a compact DWF, a slightly less compact but ubiquitous PDF, or a very space-hungry DWFx? Time will tell, but I think this issue of DWF in Vista is getting way to much spin and not enough critical analysis.

Demand Loading a VLX File

Some years ago I wrote a small ObjectARX module named VLXLoad that loads a .vlx file of the same name and in the same directory as the .arx module. I never claimed credit for the utility, but now that I’ve released the source code, I guess I’ll have to own up to it.

If you’re interested in seeing an example of “dynamically” defining an ADS (lisp callable) function when an ObjectARX module loads, take a look at the VLXLoad source code. The code also demonstrates how to call the GetModuleFileName() WinAPI function to get the path of the executing module, and how to declare and use the undocumented ads_queueexpr() function.

There is no documentation (and probably no comments), so be warned. The download contains ready to build projects for Visual Studio 2002 (targeting AutoCAD 2004-2006) and Visual Studio 2005 (targeting AutoCAD 2007). These projects were both created with the corresponding ObjectARX wizard, and are included in the course materials for my “High-Octane ObjectARX” class at AU 2006 as an example of a simple (yet very useful) ObjectARX application.

If you just want to use VLXLoad, I’ve also made the original pre-built binaries available on my Freebies page. The idea is to rename the correct .arx file so it matches the name of your .vlx, then set up registry demand loading so that the .arx loads when AutoCAD starts. The .arx then loads the associated .vlx file, and voila, demand loading for .vlx files. Instructions for setting up demand loading have been posted on the ‘net in the past (and it is well documented in the ObjectARX SDK), so I won’t describe that here.