Nicely done Dan - good example of using the UserConfigurationManager and related objects.
I have noticed, that if you change settings that are stored in the profile through the AutoCAD options dialog, those changed values aren't persisted to the registry until a successful autoCAD shutdown. So, changing a value through a session and then reading the registry for that value, *might* not give you the actual value right at that moment in time.
I've done something like this before, but I don't have autocad or an ide on this machine so I can't remember the exact syntax, but it was something like this:
using acadApp = Autodesk.AutoCAD.ApplicationServices.Application;
...
AcadPreferences acadPrefs = acadApp.Preferences as AcadPreferences;
if (acadPrefs == null)
return;
AcadPreferencesFiles acadPrefsFiles = acadPrefs.Files;
if (acadPrefsFiles == null)
return;
acadPrefsFiles.TemplateDwgPath = projectTemplatePath;
// Clean up COM references
Marshal.ReleaseComObject(acadPrefsFiles);
Marshal.ReleaseComObject(acadPrefs);
...
Something along those lines...
This changes the Template path as an example from some of my code files.
Cheers,
Glenn.