# Pins class

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

```cs
public sealed class Pins : IStorable
```

Class for maintaining all pins stuck into a cushion.

## Constructors

- [Pins](https://developer.rhino3d.com/api/gh2/type/grasshopper2.parameters.pins/ctor.md): (2 overloads) Deserialisation constructor.

## Properties

- [Above](https://developer.rhino3d.com/api/gh2/type/grasshopper2.parameters.pins/above.md): Enumerate upwards over all the pins above this object.
- [AboveAndBelow](https://developer.rhino3d.com/api/gh2/type/grasshopper2.parameters.pins/aboveandbelow.md): Enumerate over both the above and the below pins.
- [AboveCount](https://developer.rhino3d.com/api/gh2/type/grasshopper2.parameters.pins/abovecount.md): Gets the number of pins stuck to the top of the object.
- [Below](https://developer.rhino3d.com/api/gh2/type/grasshopper2.parameters.pins/below.md): Enumerate downwards over all the pins below this object.
- [BelowCount](https://developer.rhino3d.com/api/gh2/type/grasshopper2.parameters.pins/belowcount.md): Gets the number of pins stuck to the bottom of the object.
- [Count](https://developer.rhino3d.com/api/gh2/type/grasshopper2.parameters.pins/count.md): Gets the total number of pins in this collection.
- [Object](https://developer.rhino3d.com/api/gh2/type/grasshopper2.parameters.pins/object.md): Gets the object this collection is associated with. The instance is guaranteed to implement the [IPinCushion](https://developer.rhino3d.com/api/gh2/type/grasshopper2.parameters.ipincushion.md) interface.
- [PinsAndIndices](https://developer.rhino3d.com/api/gh2/type/grasshopper2.parameters.pins/pinsandindices.md): Enumerate over all pins and their indices.

## Indexers

- [this[]](https://developer.rhino3d.com/api/gh2/type/grasshopper2.parameters.pins/item.md): Pin InstanceId for the pin at the given index.

## Methods

- [BothAgree](https://developer.rhino3d.com/api/gh2/type/grasshopper2.parameters.pins/bothagree.md): (static) Gets whether both the pin and the object agree that they belong together. Note that if this method returns false, the objects are not in a valid state. Although it probably doesn't stop Grasshopper from solving the document, it is nevertheless a serious issue.
- [CanBeAttachedTo](https://developer.rhino3d.com/api/gh2/type/grasshopper2.parameters.pins/canbeattachedto.md): (static) Test whether a specific pin can be attached to a given object. This method will test not just whether the association is in principle allowed, but also whether there's room for the given pin.
- [FindObject](https://developer.rhino3d.com/api/gh2/type/grasshopper2.parameters.pins/findobject.md): (static) Find the object (if any) into which the given pin is stuck.
- [GetInsertionSlots](https://developer.rhino3d.com/api/gh2/type/grasshopper2.parameters.pins/getinsertionslots.md): (static) Enumerate over all pinning slots for an object.
- [GetPin](https://developer.rhino3d.com/api/gh2/type/grasshopper2.parameters.pins/getpin.md): Find the most relevant pin which affects the object which owns this Pins instance. Note that this method also searches groups which wrap this object, as well as parent documents which host this document.
- [GetTree](https://developer.rhino3d.com/api/gh2/type/grasshopper2.parameters.pins/gettree.md): (2 overloads) Find the most relevant instance of a pin of the given type and return its volatile data.
- [IsCompatibleWith](https://developer.rhino3d.com/api/gh2/type/grasshopper2.parameters.pins/iscompatiblewith.md): (static) Tests whether a pin can in principle be attached to the given object.
- [IsPinned](https://developer.rhino3d.com/api/gh2/type/grasshopper2.parameters.pins/ispinned.md): (2 overloads) Test whether a pin with the given type id is attached to this object.
- [Pin](https://developer.rhino3d.com/api/gh2/type/grasshopper2.parameters.pins/pin.md): (static) Stick a pin into the given object at the given pinning index. This method also removes the pin from any object it is currently stuck into.
- [ResolvePins](https://developer.rhino3d.com/api/gh2/type/grasshopper2.parameters.pins/resolvepins.md): Find all pins which affect the object which owns this Pins instance. This is limited to only those pins which are supported by the object. Note that this method also collects pins attached to groups which wrap this object, as well as any parent documents.
- [Store](https://developer.rhino3d.com/api/gh2/type/grasshopper2.parameters.pins/store.md)
- [Unpin](https://developer.rhino3d.com/api/gh2/type/grasshopper2.parameters.pins/unpin.md): (static) Detach a pin from whatever object it is attached to.

## Events

- [PinAdded](https://developer.rhino3d.com/api/gh2/type/grasshopper2.parameters.pins/pinadded.md): Raised after a pin was added to this collection.
- [PinRemoved](https://developer.rhino3d.com/api/gh2/type/grasshopper2.parameters.pins/pinremoved.md): Raised after a pin is removed from this collection.
