# HatchPattern class

Namespace: [Rhino.DocObjects](https://developer.rhino3d.com/api/rhinocommon/namespace/rhino.docobjects.md) · Assembly: [RhinoCommon](https://developer.rhino3d.com/api/rhinocommon/assembly/rhinocommon.md)

```cs
[Serializable]
public sealed class HatchPattern : ModelComponent
```

## Constructors

- [HatchPattern](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.hatchpattern/ctor.md): (2 overloads)

## Properties

- [AlwaysModelDistances](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.hatchpattern/alwaysmodeldistances.md): Hatchpattern patterns are typically interpreted as distances on the printed output when printing. In this case AlwaysModelDistances is false (default). When set to true, the hatch pattern will be interpreted as being in world distances.
- [ComponentType](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.hatchpattern/componenttype.md): Returns [ModelComponentType.HatchPattern](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.modelcomponenttype.md).
- [Description](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.hatchpattern/description.md): Gets and sets a short description of the pattern.
- [FillType](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.hatchpattern/filltype.md): Gets the pattern's fill type.
- [HatchLineCount](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.hatchpattern/hatchlinecount.md): Get the number of HatchLines in the pattern.
- [HatchLines](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.hatchpattern/hatchlines.md): Gets all the hatch lines.
- [Index](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.hatchpattern/index.md): Index in the hatch pattern table for this pattern. -1 if not in the table.
- [InUse](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.hatchpattern/inuse.md): Returns true if the hatch pattern is in use by a Rhino object, a layer, an instance definition, or a section style.
- [IsDeleted](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.hatchpattern/isdeleted.md): Deleted hatch patterns are kept in the runtime hatch pattern table so that undo will work with hatch patterns. Call IsDeleted to determine to determine if a hatch pattern is deleted.
- [IsReference](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.hatchpattern/isreference.md): Rhino allows multiple files to be viewed simultaneously. Hatch patterns in the document are "normal" or "reference". Reference hatch patterns are not saved.
- [PatternUnitSystem](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.hatchpattern/patternunitsystem.md): Hatchpattern patterns are typically defined as distances on the printed output when printing. In this case PatternUnitSystem is UnitSystem.None (default). When set to any other unit system, the hatch pattern will be scaled acordingly.
- [UserStringCount](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.hatchpattern/userstringcount.md): Gets the amount of user strings.

## Methods

- [AddHatchLine](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.hatchpattern/addhatchline.md): Add a HatchLine to the pattern.
- [CreatePreviewGeometry](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.hatchpattern/createpreviewgeometry.md): Creates preview line segments of the hatch pattern.
- [DeleteAllUserStrings](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.hatchpattern/deletealluserstrings.md)
- [DeleteUserString](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.hatchpattern/deleteuserstring.md)
- [GetDefaultHatchPatterns](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.hatchpattern/getdefaulthatchpatterns.md): (static) Gets Rhino default hatch patterns. These patterns are not in the document hatch pattern table.
- [GetUserString](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.hatchpattern/getuserstring.md): Gets user string from this geometry.
- [GetUserStrings](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.hatchpattern/getuserstrings.md): Gets a copy of all (user key string, user value string) pairs attached to this geometry.
- [HatchLineAt](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.hatchpattern/hatchlineat.md): Gets a HatchLine at an index.
- [OnSwitchToNonConst](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.hatchpattern/onswitchtononconst.md)
- [ReadFromFile](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.hatchpattern/readfromfile.md): (static) Reads hatch pattern definitions from a file.
- [RemoveAllHatchLines](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.hatchpattern/removeallhatchlines.md): Remove all of the hatch line from the pattern.
- [RemoveHatchLine](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.hatchpattern/removehatchline.md): Remove a hatch line from the pattern.
- [SetHatchLines](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.hatchpattern/sethatchlines.md): Set all of the hatch lines at once. Existing hatch lines are deleted.
- [SetUserString](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.hatchpattern/setuserstring.md): Attach a user string (key,value combination) to this geometry.
- [WriteToFile](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.hatchpattern/writetofile.md): (2 overloads, static) Writes a hatch pattern defintion to a file.

## Inherited Members

- From [ModelComponent](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.modelcomponent.md): [ComponentStatus](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.modelcomponent/componentstatus.md), [DeletedName](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.modelcomponent/deletedname.md), [HasId](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.modelcomponent/hasid.md), [HasIndex](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.modelcomponent/hasindex.md), [HasName](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.modelcomponent/hasname.md), [Id](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.modelcomponent/id.md), [IdIsLocked](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.modelcomponent/idislocked.md), [IndexIsLocked](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.modelcomponent/indexislocked.md), [InstanceDefinitionModelSerialNumber](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.modelcomponent/instancedefinitionmodelserialnumber.md), [IsComponentStatusLocked](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.modelcomponent/iscomponentstatuslocked.md), [IsSystemComponent](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.modelcomponent/issystemcomponent.md), [ModelSerialNumber](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.modelcomponent/modelserialnumber.md), [Name](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.modelcomponent/name.md), [NameIsLocked](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.modelcomponent/nameislocked.md), [ReferenceModelSerialNumber](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.modelcomponent/referencemodelserialnumber.md), [ClearId](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.modelcomponent/clearid.md), [ClearIndex](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.modelcomponent/clearindex.md), [ClearName](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.modelcomponent/clearname.md), [DataCRC](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.modelcomponent/datacrc.md), [LockId](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.modelcomponent/lockid.md), [LockIndex](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.modelcomponent/lockindex.md), [LockName](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.modelcomponent/lockname.md), [ToString](https://developer.rhino3d.com/api/rhinocommon/type/rhino.docobjects.modelcomponent/tostring.md)
- From [CommonObject](https://developer.rhino3d.com/api/rhinocommon/type/rhino.runtime.commonobject.md): [Disposed](https://developer.rhino3d.com/api/rhinocommon/type/rhino.runtime.commonobject/disposed.md), [HasUserData](https://developer.rhino3d.com/api/rhinocommon/type/rhino.runtime.commonobject/hasuserdata.md), [IsDocumentControlled](https://developer.rhino3d.com/api/rhinocommon/type/rhino.runtime.commonobject/isdocumentcontrolled.md), [IsValid](https://developer.rhino3d.com/api/rhinocommon/type/rhino.runtime.commonobject/isvalid.md), [UserData](https://developer.rhino3d.com/api/rhinocommon/type/rhino.runtime.commonobject/userdata.md), [UserDictionary](https://developer.rhino3d.com/api/rhinocommon/type/rhino.runtime.commonobject/userdictionary.md), [ConstructConstObject](https://developer.rhino3d.com/api/rhinocommon/type/rhino.runtime.commonobject/constructconstobject.md), [Dispose](https://developer.rhino3d.com/api/rhinocommon/type/rhino.runtime.commonobject/dispose.md), [EnsurePrivateCopy](https://developer.rhino3d.com/api/rhinocommon/type/rhino.runtime.commonobject/ensureprivatecopy.md), [GetObjectData](https://developer.rhino3d.com/api/rhinocommon/type/rhino.runtime.commonobject/getobjectdata.md), [IsValidWithLog](https://developer.rhino3d.com/api/rhinocommon/type/rhino.runtime.commonobject/isvalidwithlog.md), [NonConstOperation](https://developer.rhino3d.com/api/rhinocommon/type/rhino.runtime.commonobject/nonconstoperation.md), [ToJSON](https://developer.rhino3d.com/api/rhinocommon/type/rhino.runtime.commonobject/tojson.md)
