Archive for the ‘Technical’ Category.

The Cancel Retry Paradox

Yesterday when I attempted to install the AutoCAD 2011 service pack (er, I mean “update”), I encountered the classic UI paradox where you’re forced to choose from a set of equally undesirable choices, this time with a bonus.

I received error 1321. My choices were to retry or cancel. If I chose to retry, I got the same error again. If I chose to cancel, I got a bonus question: it asked whether I really wanted to cancel. I had to lie and choose yes, otherwise I would be trapped in an infinite loop.

The error message indicated that the cause was the installer’s inability to write to the original installation media. I’m not sure why it wanted to write to the original media. The only way to apply the service pack was to uninstall AutoCAD, create a temporary copy of the original media with write permission enabled for the copy, then reinstall AutoCAD from the copy and apply the service pack afterward.

Missing Language Pack DWG File Repair

I wrote before about corrupt text causing bogus “Missing Language Pack” warnings in AutoCAD. That case prompted me to write a file repair utility. However, since the case appeared to be isolated, I never released the utility to the public.

The problem has been rearing its ugly head again, so I decided to dust off the original code and release it. The repair utility is now available on the freebies page (look for CleanLanguage.zip) for AutoCAD 2007 and later versions of AutoCAD. I have not tested any recent cases, so I can’t be sure it is the same problem. If you try the utility, please report your results by leaving a comment here.

Using VC 7 build tools in Visual Studio 2010

Developers, if you use VC Build Hook and/or need the same capability in Visual Studio 2010, please let Microsoft know by voting for a fix. I’ve written before (and here) about the problem. I think it is possible to hack a third party solution, but by far the best solution is for Microsoft to add back the ability to produce ANSI response files in service pack 1.

GlowCode Success Story

I use GlowCode for profiling ObjectARX applications. As far as I know, this is the only profiler that works with AutoCAD. What makes GlowCode special is that it can instrument code on the fly, including a monster like AutoCAD. It has a clunky interface that takes some patience to figure out, but it’s a lifesaver when you need it.

Recently a CADLock customer sent us a drawing file that was apparently not very complicated, yet it took over 20 minutes to create a deep vault. To determine the cause, I used GlowCode to profile the vault creation process. I could see almost immediately that most of the time was being spent in AcDbObjectId::operator ==, which was being called from AcDbObjectIdArray::find.

This turned out to be a classic case of using the wrong type of container. Searching an AcDbObjectIdArray isn’t bad when the array is small, but this drawing contained a special case where the array was very large, and this special case exposed the flaw. I changed the array to a std::set and tested again. The new time was 30 seconds to create the vault – a slight reduction of approximately 95%.

[Full Disclosure: Electric Software has for many years provided me with a complimentary license of GlowCode in exchange for my testing and feedback.]

Visual Studio 2010 Ships

Visual Studio 2010 shipped today accompanied by .NET Framework 4.0. I blogged before about the switch to using the MSBuild build system, and how that theoretically could be helpful in targeting multiple AutoCAD versions from the same solution. The shipping VS 2010 does not support non-Unicode response files, so out-of-the-box it cannot target VC 7.0 (for AutoCAD 2006 and earlier). When time permits, I’m planning to see if I can find a workaround; in the meantime, I’ll continue to use VS 2008 for ObjectARX.