The Autodesk.Revit.DB.ConfigurationReloadInfo
class is used to reload various configuration settings in Revit. This class is found in the Autodesk.Revit.DB
namespace and can be used with Revit's API.
CategoryMapsReloadNeeded
: A boolean value that indicates whether or not the category maps must be reloaded.ExternalResourceReloadNeeded
: A boolean value that indicates whether or not external resources must be reloaded.FamilyReloadNeeded
: A boolean value that indicates whether or not families must be reloaded.GroupTypeReloadNeeded
: A boolean value that indicates whether or not group types must be reloaded.LineStyleReloadNeeded
: A boolean value that indicates whether or not line styles must be reloaded.ParameterReloadNeeded
: A boolean value that indicates whether or not parameters must be reloaded.SettingsReloadNeeded
: A boolean value that indicates whether or not settings must be reloaded.Equals(Object)
: Determines whether or not the specified Object
is equal to the current ConfigurationReloadInfo
instance.GetHashCode()
: Returns the hash code for the current ConfigurationReloadInfo
instance.This class is used in conjunction with the IExternalDBApplication.OnShutdown()
method. The OnShutdown()
method is called by Revit when a user is about to shutdown the application. A developer can use the ConfigurationReloadInfo
property of the OnShutdown()
method to determine if any configuration settings need to be reloaded before the shutdown occurs.
This class is also used with the UIApplication.ReloadDefaultFamilyTemplatesAndGroups()
method. This method is used to reload any changes to the default family templates and groups.
Here is an example of how to use the ConfigurationReloadInfo
class in a Revit application:
public Result OnShutdown(UIControlledApplication application)
{
ConfigurationReloadInfo configReloadInfo = application.GetConfigurationReloadInfo();
if (configReloadInfo.SettingsReloadNeeded)
{
// Reload settings
}
if (configReloadInfo.FamilyReloadNeeded)
{
// Reload families
}
// etc...
return Result.Succeeded;
}
In this example, the GetConfigurationReloadInfo()
method is called on the UIControlledApplication
instance to retrieve the configuration reload information. The if
statements check whether or not any configuration settings need to be reloaded, and then the appropriate actions are taken based on the needs of the application.