Random thoughts about AutoCAD, ObjectARX, and the meaning of life.
All Original Content Copyright 2006 - 2008 Owen Wengerd, All Rights Reserved
Labels: AutoCAD, Autodesk, ObjectARX, programming
Labels: ObjectARX, programming, Visual Studio
(princ "\nThis test file loaded from ")
(princ (if GetPathOf!LspLoadTest (GetPathOf!LspLoadTest) ""))
(princ)
This test file loaded from W:\LspLoad\
Labels: AutoCAD, Bricscad, ObjectARX, programming
Labels: Autodesk, discussion groups, programming
One of my many complaints about about the CUI system introduced in AutoCAD 2006 is that it's not very friendly to third party developers. In my opinion, it's not very friendly to end users either, but I digress...
One example of the unfriendly CUI is the case where a third party application installs a partial menu. In the pre-CUI days, adding a partial menu was an easy way to add an application specific menu to AutoCAD without making any changes to the end user's existing menu files. If the application was later uninstalled, the uninstall script could remove its menu and clean up the registry, leaving no trace behind. CUI breaks that scenario.
When a partial menu is loaded into AutoCAD 2006 and later, the CUI system actually writes a reference to the new partial menu into the main .cui file. To make matters worse, there is no clean way to programmatically remove those references because there is no deterministic way to locate all the .cui files used by a specific instance of AutoCAD from an uninstall script running outside of AutoCAD.
This would not be the end of the world if AutoCAD simply ignored references to missing files, but it doesn't. When the CUI command starts, it detects the missing files and displays an obnoxious message box that must be dismissed before the command will continue.
Then to top it off, AutoCAD displays a second message box that also must be dismissed.
I think it should be obvious even to an untrained UI designer how ridiculous this is.
In AutoCAD 2006 and 2007, the solution is to dutifully dismiss both dialogs, then when the CUI dialog finally appears, click [Apply] to rewrite the .cui file without the missing partial menu references. In AutoCAD 2008 and 2009, you have to first expand the 'Partial CUI Files' node in the Customization tab, then right-click on the unresolved partial menu file and select 'Unload CUI File', then click [Apply].
Labels: AutoCAD, CUI, programming
I have presented a class entitled High Octane ObjectARX at Autodesk University the past two years. In 2006 the focus was on project organization, and last year I focused more on techniques for supporting multiple versions of AutoCAD with a single Visual Studio solution, touching briefly on testing and profiling. For 2007 I plan to focus on debugging.
To get you in the mood, I decided to blog about a capability of Visual Studio that often goes unnoticed and unused: breaking on an exception. This works just like breaking on a code breakpoint, except the debugger breaks execution *before* the exception handler gets control, thus allowing you to get a clearer picture of what was happening immediately before the exception occurred.
In an ObjectARX project, all kinds of exceptions can occur. Sometimes they are perfectly normal exceptions caused by and handled by AutoCAD. Many times, especially during development, your code triggers an exception that causes AutoCAD to crash, and it's not obvious what caused things to go haywire.
When unexpected things happen while running your code under the debugger, the first order of business is to inspect the debug output window to determine what happened. The debug output window (Debug->Windows->Output) displays a message whenever an exception occurs. Sometimes a series of exceptions occur, usually all caused by the same root problem. Breaking when the first exception occurs will likely yield the most useful information about the cause.
Once you examine the debug output window to determine the type of exception that occurred, open the Exceptions dialog (Debug->Exceptions) and tell Visual Studio to break when the exception is thrown:
Visual Studio contains a prepopulated list of common exceptions to choose from, or you can add new ones if you need to break on an exception that is not already listed. Many times, breaking when the exception is thrown allows you to inspect the stack trace to determine which one of your functions is to blame -- and in the vast majority of cases, it will be your code that is at fault!
Labels: Autodesk University, ObjectARX, programming, Visual Studio
The Cold List
I presented the first of two ObjectARX roundtable discussions this year (the second one, hosted by Stephen Preston, also covered .NET). This was an experimental format. I liked it, and I thought it went well. If you were there, I'd like to hear your suggestions for making it better next year. I will be following up with some more posts covering topics raised in this and other AU classes.
Labels: AU 2007, ObjectARX, programming
Labels: Microsoft, ObjectARX, programming, Visual Studio
Labels: AutoCAD, ObjectARX, ObjectDCL, OpenDCL, programming
Labels: ObjectARX, programming, Visual Studio
Labels: ManuSoft, Periscope, programming, QuikPik, SuperPurge
Labels: AutoCAD, ObjectARX, ObjectDCL, OpenDCL, programming, Visual Studio
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestversion="1.0">
<dependency>
<dependentassembly>
<assemblyidentity type="win32" name="Microsoft.VC80.ATL" version="8.0.50727.762" processorarchitecture="x86" publickeytoken="1fc8b3b9a1e18e3b">
</assemblyidentity>
</dependentassembly>
</dependency>
</assembly>
Labels: ATL, manifest, Microsoft, ObjectARX, programming, Visual Studio
Labels: Autodesk, CMS, ODA, programming, Visual Studio
Labels: Microsoft, ObjectARX, programming, Visual Studio
Labels: Microsoft, ObjectARX, programming, Visual Studio
Labels: ObjectARX, programming, Visual Studio
Labels: ObjectARX, programming
Labels: AU 2006, AutoCAD, programming
I'm a starving artist specializing in the programming genre. I work in my home office, where I am the owner and sole proprietor of ManuSoft as well as the President and chief software artist of CADLock, Inc.