# GH_Stack class

Namespace: [Grasshopper.GUI.Stacks](https://developer.rhino3d.com/api/gh1/namespace/grasshopper.gui.stacks.md) · Assembly: [Grasshopper](https://developer.rhino3d.com/api/gh1/assembly/grasshopper.md)

```cs
public class GH_Stack
```

Represents a manager for animating asynchronous box movements. This is a useful feature for GUIs that want to mimic physical behaviour or continuous UI changes.

**Remarks:** This class is ABSOLUTELY NOT Thread-safe.

## Constructors

- [GH_Stack](https://developer.rhino3d.com/api/gh1/type/grasshopper.gui.stacks.gh-stack/ctor.md): (4 overloads)

## Properties

- [Count](https://developer.rhino3d.com/api/gh1/type/grasshopper.gui.stacks.gh-stack/count.md): Gets the number of items in the stack.
- [Duration](https://developer.rhino3d.com/api/gh1/type/grasshopper.gui.stacks.gh-stack/duration.md): Gets or sets the duration (in milliseconds) of individual frame animations. This change is only applied to new animations. Existing animations will keep the duration set at construction.
- [Element_Final](https://developer.rhino3d.com/api/gh1/type/grasshopper.gui.stacks.gh-stack/element-final.md): Gets or sets the target dimenions of the stack element at the given index. If you overwrite the existing value with a different value, a new animation will be initiated for this stack element. If you wish to retrieve the current (based on system time) stack element dimensions, you should use the Intermediate readonly property.
- [Element_Initial](https://developer.rhino3d.com/api/gh1/type/grasshopper.gui.stacks.gh-stack/element-initial.md): Gets the starting dimensions of the stack element at the given index.
- [Element_Intermediate](https://developer.rhino3d.com/api/gh1/type/grasshopper.gui.stacks.gh-stack/element-intermediate.md): Gets the intermediate dimensions for the specified physical stack element as determined by the current system time.
- [InMotion](https://developer.rhino3d.com/api/gh1/type/grasshopper.gui.stacks.gh-stack/inmotion.md): (2 overloads) Gets a value that indicates whether or not any element in this stack is currently in motion.
- [Interpolation](https://developer.rhino3d.com/api/gh1/type/grasshopper.gui.stacks.gh-stack/interpolation.md): Gets or sets the interpolation mode for stack animations. Cubic results in a more natural motion. Although you can change the interpolation during animation, it might result in a discontinuous motion. You should set the desired interpolation algorithm during or directly after construction of this stack.
- [UpdateInterval](https://developer.rhino3d.com/api/gh1/type/grasshopper.gui.stacks.gh-stack/updateinterval.md): Gets or sets the interval (in milliseconds) for update events.

## Methods

- [AddElement](https://developer.rhino3d.com/api/gh1/type/grasshopper.gui.stacks.gh-stack/addelement.md): (3 overloads) Add a new animated element to the stack.
- [Clear](https://developer.rhino3d.com/api/gh1/type/grasshopper.gui.stacks.gh-stack/clear.md): Remove all boxes, timestamps and animators.
- [Destroy](https://developer.rhino3d.com/api/gh1/type/grasshopper.gui.stacks.gh-stack/destroy.md): Call this function when you are certain you will no longer need the stack. It will disable any current update events and clear animation instances.
- [Finalize](https://developer.rhino3d.com/api/gh1/type/grasshopper.gui.stacks.gh-stack/finalize.md)
- [InsertElement](https://developer.rhino3d.com/api/gh1/type/grasshopper.gui.stacks.gh-stack/insertelement.md): (3 overloads) Add a new animated element to the stack.
- [RemoveElement](https://developer.rhino3d.com/api/gh1/type/grasshopper.gui.stacks.gh-stack/removeelement.md): Remove the stack element at the specified index.
- [ResizeContainer](https://developer.rhino3d.com/api/gh1/type/grasshopper.gui.stacks.gh-stack/resizecontainer.md): Call this function to override the width or height of all elements without interfering with the animation.
- [SetNewTarget](https://developer.rhino3d.com/api/gh1/type/grasshopper.gui.stacks.gh-stack/setnewtarget.md): (2 overloads) Set new target dimenions for the given object.
- [SetOwner](https://developer.rhino3d.com/api/gh1/type/grasshopper.gui.stacks.gh-stack/setowner.md): (2 overloads)
