# SettingsFile class

Namespace: [Grasshopper2](https://developer.rhino3d.com/api/gh2/namespace/grasshopper2.md) · Assembly: [Grasshopper2](https://developer.rhino3d.com/api/gh2/assembly/grasshopper2.md)

```cs
public sealed class SettingsFile
```

A class for caching settings which are stored in a file.

## Constructors

- [SettingsFile](https://developer.rhino3d.com/api/gh2/type/grasshopper2.settingsfile/ctor.md): Create a new settings file which mirrors a file on the disk.

## Fields

- [Extension](https://developer.rhino3d.com/api/gh2/type/grasshopper2.settingsfile/extension.md): (static) Gets the file extension under which grasshopper settings files are stored.

## Properties

- [File](https://developer.rhino3d.com/api/gh2/type/grasshopper2.settingsfile/file.md): Gets the file path this settings file points to. The file may or may not exist.
- [Node](https://developer.rhino3d.com/api/gh2/type/grasshopper2.settingsfile/node.md): Gets the underlying node which stores the values. Careful when using this object directly, you may for example not overwrite existing values, you must delete them first. Also, changes made directly to the node will not cause a settings file update.

## Methods

- [Clear](https://developer.rhino3d.com/api/gh2/type/grasshopper2.settingsfile/clear.md): Clear all settings.
- [Get](https://developer.rhino3d.com/api/gh2/type/grasshopper2.settingsfile/get.md): (13 overloads) Retrieve a bool from the cached settings.
- [InDefaultFolder](https://developer.rhino3d.com/api/gh2/type/grasshopper2.settingsfile/indefaultfolder.md): (static) Create or load a settings file by name in the default Grasshopper 2.0 settings folder.
- [Rename](https://developer.rhino3d.com/api/gh2/type/grasshopper2.settingsfile/rename.md): Attempt to rename a setting. If another setting with the newName already exists, it will be removed, even if the oldName does not point to an existing setting.
- [Set](https://developer.rhino3d.com/api/gh2/type/grasshopper2.settingsfile/set.md): (13 overloads) Store a boolean in the cached settings.
- [TryLoadSettingsFromFile](https://developer.rhino3d.com/api/gh2/type/grasshopper2.settingsfile/tryloadsettingsfromfile.md): Load the settings form the file. This happens automatically on construction, so you only need to call this method if you have reason to believe the settings file was modified by a process other than this SettingsFile.
- [TrySaveSettingsToFile](https://developer.rhino3d.com/api/gh2/type/grasshopper2.settingsfile/trysavesettingstofile.md): Write the current state of this SettingsFile to the file on the disk.
