# Modifiers class

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

```cs
[IoId("00000000-d22a-4b09-92af-cec49036f042")]
public sealed class Modifiers : IEquatable<Modifiers>, IStorable
```

Encapsulates all standard modifiers that can be applied to a data tree.

## Constructors

- [Modifiers](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.modifiers/ctor.md): Deserialize an instance of this class.

## Properties

- [Empty](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.modifiers/empty.md): (static) Gets the default, empty modifiers.
- [Flatten](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.modifiers/flatten.md): Gets whether the data tree ought to be flattened.
- [Graft](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.modifiers/graft.md): Gets whether the data tree ought to be grafted.
- [Icons](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.modifiers/icons.md): Gets an array of modeicons, representing all active modifiers. This array is cached and should not be modified.
- [Increment](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.modifiers/increment.md): Gets whether the data tree ought to have its paths renumbered incrementally.
- [IsEmpty](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.modifiers/isempty.md): Gets whether any modifiers are enabled.
- [Randomise](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.modifiers/randomise.md): Gets whether the items inside twigs ought to be randomised. This setting makes no sense in combination with Sort or Reverse.
- [RemoveEmptyTwigs](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.modifiers/removeemptytwigs.md): Gets whether empty twigs ought to be removed from the data tree.
- [RemoveInvalidItems](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.modifiers/removeinvaliditems.md): Gets whether invalid items ought to be removed from the data tree.
- [RemoveMetaData](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.modifiers/removemetadata.md): Gets whether all meta data ought to be removed from the data tree.
- [RemoveNullItems](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.modifiers/removenullitems.md): Gets whether null items ought to be removed from the data tree.
- [Renumber](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.modifiers/renumber.md): Gets whether the data tree ought to be renumbered.
- [Reverse](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.modifiers/reverse.md): Gets whether the data tree ought to be reversed.
- [Simplify](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.modifiers/simplify.md): Gets whether the data tree ought to be simplified.
- [Sort](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.modifiers/sort.md): Gets whether the twigs ought to be sorted. This method will either use the default Comparer or find a comparer based on type assistants.
- [Trim](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.modifiers/trim.md): Gets the trim-depth. The [depth] number of elements will be removed from all leading tree elements and appropriate merging will happen.

## Methods

- [Apply](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.modifiers/apply.md): (4 overloads) Apply all enabled modifiers to a data tree.
- [Equals](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.modifiers/equals.md): (2 overloads) Compare two modifiers for equality.
- [GetHashCode](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.modifiers/gethashcode.md): Gets the hash code of these modifiers.
- [Store](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.modifiers/store.md): Serialize these modifiers.
- [WillAffectTree](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.modifiers/willaffecttree.md): Tests whether any modifiers have been defined that apply to the given tree. This method does not check whether RemoveInvalidItems should or shouldn't execute, as testing for validity is potentially an expensive operation.
- [WithEmptyTwigRemoval](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.modifiers/withemptytwigremoval.md): Sets the [Modifiers.RemoveEmptyTwigs](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.modifiers/removeemptytwigs.md) flag and returns an updated Modifiers instance.
- [WithFlatten](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.modifiers/withflatten.md): Sets the [Modifiers.Flatten](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.modifiers/flatten.md) flag and returns an updated Modifiers instance.
- [WithGrafting](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.modifiers/withgrafting.md): Sets the [Modifiers.Graft](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.modifiers/graft.md) flag and returns an updated Modifiers instance.
- [WithIncrement](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.modifiers/withincrement.md): Sets the [Modifiers.Increment](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.modifiers/increment.md) flag and returns an updated Modifiers instance.
- [WithInvalidItemRemoval](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.modifiers/withinvaliditemremoval.md): Sets the [Modifiers.RemoveInvalidItems](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.modifiers/removeinvaliditems.md) flag and returns an updated Modifiers instance.
- [WithMetaDataRemoval](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.modifiers/withmetadataremoval.md): Sets the [Modifiers.RemoveMetaData](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.modifiers/removemetadata.md) flag and returns an updated Modifiers instance.
- [WithNullItemRemoval](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.modifiers/withnullitemremoval.md): Sets the [Modifiers.RemoveNullItems](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.modifiers/removenullitems.md) flag and returns an updated Modifiers instance.
- [WithoutEmptyTwigRemoval](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.modifiers/withoutemptytwigremoval.md): Removes the [Modifiers.RemoveEmptyTwigs](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.modifiers/removeemptytwigs.md) flag and returns an updated Modifiers instance.
- [WithoutFlatten](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.modifiers/withoutflatten.md): Remove the [Modifiers.Flatten](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.modifiers/flatten.md) flag and returns an updated Modifiers instance.
- [WithoutGrafting](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.modifiers/withoutgrafting.md): Removes the [Modifiers.Graft](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.modifiers/graft.md) flag and returns an updated Modifiers instance.
- [WithoutIncrement](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.modifiers/withoutincrement.md): Removes the [Modifiers.Increment](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.modifiers/increment.md) flag and returns an updated Modifiers instance.
- [WithoutInvalidItemRemoval](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.modifiers/withoutinvaliditemremoval.md): Removes the [Modifiers.RemoveInvalidItems](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.modifiers/removeinvaliditems.md) flag and returns an updated Modifiers instance.
- [WithoutMetaDataRemoval](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.modifiers/withoutmetadataremoval.md): Removes the [Modifiers.RemoveMetaData](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.modifiers/removemetadata.md) flag and returns an updated Modifiers instance.
- [WithoutNullItemRemoval](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.modifiers/withoutnullitemremoval.md): Removes the [Modifiers.RemoveNullItems](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.modifiers/removenullitems.md) flag and returns an updated Modifiers instance.
- [WithoutRandomise](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.modifiers/withoutrandomise.md): Removes the [Modifiers.Randomise](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.modifiers/randomise.md) flag and returns an updated Modifiers instance.
- [WithoutRenumber](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.modifiers/withoutrenumber.md): Removes the [Modifiers.Renumber](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.modifiers/renumber.md) flag and returns an updated Modifiers instance.
- [WithoutReverse](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.modifiers/withoutreverse.md): Removes the [Modifiers.Reverse](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.modifiers/reverse.md) flag and returns an updated Modifiers instance.
- [WithoutSimplify](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.modifiers/withoutsimplify.md): Removes the [Modifiers.Simplify](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.modifiers/simplify.md) flag and returns an updated Modifiers instance.
- [WithoutSorting](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.modifiers/withoutsorting.md): Removes the [Modifiers.Sort](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.modifiers/sort.md) flag and returns an updated Modifiers instance.
- [WithoutTrimming](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.modifiers/withouttrimming.md): Removes the trim depth and returns an updated Modifiers instance.
- [WithRandomise](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.modifiers/withrandomise.md): Sets the [Modifiers.Randomise](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.modifiers/randomise.md) flag and returns an updated Modifiers instance.
- [WithRenumber](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.modifiers/withrenumber.md): Sets the [Modifiers.Renumber](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.modifiers/renumber.md) flag and returns an updated Modifiers instance.
- [WithReverse](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.modifiers/withreverse.md): Sets the [Modifiers.Reverse](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.modifiers/reverse.md) flag and returns an updated Modifiers instance.
- [WithSimplify](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.modifiers/withsimplify.md): Sets the [Modifiers.Simplify](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.modifiers/simplify.md) flag and returns an updated Modifiers instance.
- [WithSorting](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.modifiers/withsorting.md): Sets the [Modifiers.Sort](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.modifiers/sort.md) flag and returns an updated Modifiers instance.
- [WithTrimming](https://developer.rhino3d.com/api/gh2/type/grasshopper2.data.modifiers/withtrimming.md): Sets the trim depth and returns an updated Modifiers instance.
