# Capsule class

Namespace: [Grasshopper2.UI.Primitives](https://developer.rhino3d.com/api/gh2/namespace/grasshopper2.ui.primitives.md) · Assembly: [Grasshopper2](https://developer.rhino3d.com/api/gh2/assembly/grasshopper2.md)

```cs
public sealed class Capsule
```

Represents the basic Grasshopper UI capsule object. A capsule is a slab with optional plugs and messaging bar.

## Constructors

- [Capsule](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.primitives.capsule/ctor.md): Create a capsule.

## Properties

- [BarHeight](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.primitives.capsule/barheight.md): Gets the height of the messaging bar.
- [Bounds](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.primitives.capsule/bounds.md): Get the outer bounds of the entire capsule.
- [HasAnyMessage](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.primitives.capsule/hasanymessage.md): Gets whether any message indicator has been set.
- [HasErrorMessage](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.primitives.capsule/haserrormessage.md): Gets or sets whether the error message indicator ought to be drawn.
- [HasInfoMessage](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.primitives.capsule/hasinfomessage.md): Gets or sets whether the info message indicator ought to be drawn.
- [HasInputPlugs](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.primitives.capsule/hasinputplugs.md): Gets whether any input plugs have been set.
- [HasOutputPlugs](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.primitives.capsule/hasoutputplugs.md): Gets whether any output plugs have been set.
- [HasWarningMessage](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.primitives.capsule/haswarningmessage.md): Gets or sets whether the warning message indicator ought to be drawn.
- [InputPlugCount](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.primitives.capsule/inputplugcount.md): Gets the number of input plugs on this capsule.
- [OutputPlugCount](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.primitives.capsule/outputplugcount.md): Gets the number of output plugs on this capsule.
- [Slab](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.primitives.capsule/slab.md): Get the geometry of the capsule shape.

## Methods

- [AddCustomPlug](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.primitives.capsule/addcustomplug.md): Add a custom plug.
- [AddInputPlug](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.primitives.capsule/addinputplug.md): Add an input plug at a given y-coordinate.
- [AddOutputPlug](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.primitives.capsule/addoutputplug.md): Add an output plug at a given y-coordinate.
- [CreateFromInner](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.primitives.capsule/createfrominner.md): (static) Create a capsule from the inner (apex) bounds.
- [CreateFromOuter](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.primitives.capsule/createfromouter.md): (static) Create a capsule from the outer bounds.
- [Draw](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.primitives.capsule/draw.md): (2 overloads) Draw this capsule into a graphics context.
- [DrawEdges](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.primitives.capsule/drawedges.md): Draw the silhouette edges. This is typically the fifth and last part of the capsule drawing process, after [Capsule.DrawOverlay(Graphics, Skin, Shade)](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.primitives.capsule/drawoverlay.md).
- [DrawFaces](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.primitives.capsule/drawfaces.md): Draw the apex and side faces. This is typically the second part of the capsule drawing process, after [Capsule.DrawGrips(Graphics, Skin)](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.primitives.capsule/drawgrips.md).
- [DrawGrips](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.primitives.capsule/drawgrips.md): Draw all grips. This is typically the first part of the capsule drawing process.
- [DrawMessaging](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.primitives.capsule/drawmessaging.md): Draw the messaging hints, if any. This is typically the third part of the capsule drawing process, after [Capsule.DrawFaces(Graphics, Skin, Shade)](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.primitives.capsule/drawfaces.md).
- [DrawOverlay](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.primitives.capsule/drawoverlay.md): Draw the overlay. This is typically the fourth part of the capsule drawing process, after [Capsule.DrawMessaging(Graphics, Skin)](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.primitives.capsule/drawmessaging.md).
- [InputPlug](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.primitives.capsule/inputplug.md): Gets the input plug at the given index.
- [OutputPlug](https://developer.rhino3d.com/api/gh2/type/grasshopper2.ui.primitives.capsule/outputplug.md): Gets the output plug at the given index.
