# Grasshopper2.Types.Conversion namespace

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

## Classes

- [BitsAndBytes](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.conversion.bitsandbytes.md): Provides conversion methods for bit and byte arrays to and from strings.
- [ConversionAction](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.conversion.conversionaction.md): A non-generic wrapper class around a [ConversionDelegate<T, Q>](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.conversion.conversiondelegate-2.md).
- [ConversionAction<TSource, TTarget>](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.conversion.conversionaction-2.md): A wrapper class around a [ConversionDelegate<T, Q>](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.conversion.conversiondelegate-2.md).
- [ConversionException](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.conversion.conversionexception.md): Exception type thrown by failed type conversions.
- [ConversionMessage](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.conversion.conversionmessage.md): Represents a single conversion message.
- [ConversionRepository](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.conversion.conversionrepository.md): Derive from this class to provide custom conversion methods. Add any number of public, static methods that adhere to the [ConversionDelegate<TIn, TOut>](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.conversion.conversiondelegate-2.md) signature, and which are decorated with the [MeritAttribute](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.conversion.meritattribute.md) attribute.
- [ConversionServer](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.conversion.conversionserver.md): This static class collects and maintains all conversion logic.
- [ExplanationAttribute](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.conversion.explanationattribute.md): Optionally attach this attribute to all public static methods in a [ConversionRepository](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.conversion.conversionrepository.md) class in order to provide more information about how a conversion is designed.
- [FormatProperties](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.conversion.formatproperties.md): Contains string formatting properties for various types of data.
- [MeritAttribute](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.conversion.meritattribute.md): Attach this attribute to all public static methods in a [ConversionRepository](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.conversion.conversionrepository.md) class that ought to act as automatic type conversions.

## Delegates

- [ConversionDelegate<TSource, TTarget>](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.conversion.conversiondelegate-2.md): Method signature for automatic type conversions. A valid conversion delegate *must* be decorated with a [MeritAttribute](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.conversion.meritattribute.md) and may be decorated with a [ExplanationAttribute](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.conversion.explanationattribute.md). If the conversion fails due to some reason, an exception must be thrown whose message explains the failure reason. Note that the [ConversionRepository](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.conversion.conversionrepository.md) class has many helper methods for throwing these exceptions.

## Enums

- [HashFormat](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.conversion.hashformat.md): Enumerates the possible formatting types of hashes.
- [Merit](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.conversion.merit.md): Enumerates the predefined levels of conversion.
