I encountered the need and implemented solutions to save user configuration data several times over in the past.
Today, prompted by a recent query, I'll point out two of them, and some other exciting and interesting stuff as well:
- Anthony Hauck on Futures for Revit.
- The Most Popular Programming Languages 2015.
- Saving User Configuration Settings.
Anthony Hauck on Futures for Revit
BIMThoughts is a podcast platform about BIM technology and techniques.
Listen to the half-hour BIMThoughts interview with Anthony Hauck, Director of Product Strategy at Autodesk, talking about what may or may not be coming in Revit’s future:
The Most Popular Programming Languages 2015
ProgrammableWeb presents an interesting analysis of the most popular programming languages of 2015:
Check out the full article for details on how this ranking was determined.
Saving User Configuration Settings
Question: I used the .NET settings file, e.g., xxx.dll.config, to store user and application data.
Unfortunately, it does not work; manual modifications are ignored.
Apparently, it is only active at the application (.exe) level.
The project simply retains the default values for all class library projects.
I still can’t find a workaround up to this moment.
Do you have any suggestions how a Revit add-in can store external configuration data that can be modified by a user?
Answer: Yes, definitely. Thank you for bringing this up.
There are a number of ways to address this, for two of which I can present ready-made implementations on GitHub:
- First, to be clear, let's rule out the usage of the top-level application configuration file revit.exe.config. That would be a very bad idea, for a large number of reasons.
- Implement your own text format configuration file storage and parsing.
- Make use of the .NET XML configuration file storage and parsing functionality.
Text Format Configuration File Storage and Parsing
I already documented this approach when discussing the Berlin hackathon results, 3D Viewer and RvtVa3c update, in the section on custom user settings storage.
.NET XML Configuration File Storage and Parsing
Storing user settings in a config file via the .NET ConfigurationManager and OpenMappedExeConfiguration methods:
Look at my DirectShape OBJ import add-in DirectObjLoader, which also defines the kernel for the OBJ Mesh Import to DirectShape AppStore application.
Search the two blog post discussions listed above for the word 'config', and look at the Config.cs configuration file implementation and usage in the DirectObjLoader GitHub repository.