# SmlWriter class

Namespace: [GrasshopperIO.DataBase](https://developer.rhino3d.com/api/gh2/namespace/grasshopperio.database.md) · Assembly: [GrasshopperIO](https://developer.rhino3d.com/api/gh2/assembly/grasshopperio.md)

```cs
public sealed class SmlWriter
```

A basic utility class for writing SML compliant text.

## Constructors

- [SmlWriter](https://developer.rhino3d.com/api/gh2/type/grasshopperio.database.smlwriter/ctor.md)

## Properties

- [Depth](https://developer.rhino3d.com/api/gh2/type/grasshopperio.database.smlwriter/depth.md): Gets the current indentation depth.
- [IndentCode](https://developer.rhino3d.com/api/gh2/type/grasshopperio.database.smlwriter/indentcode.md): Gets the indentation string to use.
- [IndentText](https://developer.rhino3d.com/api/gh2/type/grasshopperio.database.smlwriter/indenttext.md): Gets the current indent text.

## Methods

- [BeginAttribute](https://developer.rhino3d.com/api/gh2/type/grasshopperio.database.smlwriter/beginattribute.md): (2 overloads) Begin a new attribute.
- [BeginElement](https://developer.rhino3d.com/api/gh2/type/grasshopperio.database.smlwriter/beginelement.md): (2 overloads)
- [Escape](https://developer.rhino3d.com/api/gh2/type/grasshopperio.database.smlwriter/escape.md): (static) Apply Sml escape rules for text. Hyphens are surrounded by double quotes. Strings with whitespace are surrounded by double quotes. Strings containing double quotes are surrounded by double quotes. Double quotes in strings are doubled up. Strings containing hash characters are surrounded by double quotes. Strings containing newline character are split into lines, surrounded by double quotes and separated by slashes.
- [ToString](https://developer.rhino3d.com/api/gh2/type/grasshopperio.database.smlwriter/tostring.md): Convert the text inside this writer to a string.
