# Snippet class

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

```cs
public sealed class Snippet
```

A pointer to a GHZ file containing a bunch of components acting as a snippet. The basic descriptive properties ([Snippet.Nomen](https://developer.rhino3d.com/api/gh2/type/grasshopper2.framework.snippet/nomen.md), [Snippet.Icon](https://developer.rhino3d.com/api/gh2/type/grasshopper2.framework.snippet/icon.md)) are read lazily from standalone chunks in the archive so the snippet can be drawn in the UI without deserialising the document graph. The document is only opened when a [Snippet.Preview](https://developer.rhino3d.com/api/gh2/type/grasshopper2.framework.snippet/preview.md) bitmap is requested.

## Constructors

- [Snippet](https://developer.rhino3d.com/api/gh2/type/grasshopper2.framework.snippet/ctor.md): Create a new snippet. Construction is cheap; archive contents are only read when [Snippet.Nomen](https://developer.rhino3d.com/api/gh2/type/grasshopper2.framework.snippet/nomen.md), [Snippet.Icon](https://developer.rhino3d.com/api/gh2/type/grasshopper2.framework.snippet/icon.md) or [Snippet.Preview](https://developer.rhino3d.com/api/gh2/type/grasshopper2.framework.snippet/preview.md) is accessed.

## Properties

- [File](https://developer.rhino3d.com/api/gh2/type/grasshopper2.framework.snippet/file.md): File path for snippet.
- [Icon](https://developer.rhino3d.com/api/gh2/type/grasshopper2.framework.snippet/icon.md): Gets the icon for this snippet. Loaded lazily from the archive's standalone icon chunk. If no icon chunk is present, the document is deserialised on first access and an icon is derived from its objects (preferring custom-iconned objects, then rightmost components, then rightmost other objects).
- [Id](https://developer.rhino3d.com/api/gh2/type/grasshopper2.framework.snippet/id.md): Gets a stable identifier for this snippet, derived from its file path.
- [Nomen](https://developer.rhino3d.com/api/gh2/type/grasshopper2.framework.snippet/nomen.md): Gets the nomen describing this snippet. Loaded lazily from the archive's standalone chunks ([Snippet.NameEntry](https://developer.rhino3d.com/api/gh2/type/grasshopper2.framework.snippet.md), [Snippet.InfoEntry](https://developer.rhino3d.com/api/gh2/type/grasshopper2.framework.snippet.md), [Snippet.SectionEntry](https://developer.rhino3d.com/api/gh2/type/grasshopper2.framework.snippet.md)).
- [Preview](https://developer.rhino3d.com/api/gh2/type/grasshopper2.framework.snippet/preview.md): A preview of the snippet file. Forces a full document deserialisation on first access.
- [Time](https://developer.rhino3d.com/api/gh2/type/grasshopper2.framework.snippet/time.md): Gets the time this file was last changed.
