Author Topic: UserConfigurationManager  (Read 2299 times)

0 Members and 1 Guest are viewing this topic.

sinc

  • Guest
UserConfigurationManager
« on: February 20, 2007, 02:35:35 AM »
This wasn't exactly easy to figure out - the documentation was a bit vague.  I finally got it after trying a bunch of possibilities.  So I thought I'd post an example of the usage for anyone else.

The purpose of this object seems to be that it provides three "standard" locations for placing info in the registry.  The exact location for each of the three "standard" places varies depending on version of Autocad and user login, but the three methods always return a correct location for the current conditions.  For example, the OpenGlobalSection() method in this example sets regbase to the primary (global) registry entry for the current product in HKCU/Software/Autodesk.  If you are running Civil-3D 2007, this would be in the Autocad/R17.0/ACAD-5000:409 registry subsection.  It would return a different location for a user running a different product.

Code: [Select]
UserConfigurationManager ucm = Autodesk.AutoCAD.ApplicationServices.Application.UserConfigurationManager;
IConfigurationSection regbase = ucm.OpenGlobalSection();