Capsule

References
public sealed class Capsule
Represents the basic Grasshopper UI capsule object. A capsule is a slab with optional plugs and messaging bar.

Constructors

Capsule

#
Create a capsule.
public Capsule(
slab,
Capsule shape.
barHeight = 0
Messaging bar height.
)

Properties

BarHeight

#
Gets the height of the messaging bar.
public float BarHeight { get; }

Bounds

#
Get the outer bounds of the entire capsule.
public RectangleF Bounds { get; }

HasAnyMessage

#
Gets whether any message indicator has been set.
public bool HasAnyMessage { get; }

HasErrorMessage

#
Gets or sets whether the error message indicator ought to be drawn.
public bool HasErrorMessage { get; set; }

HasInfoMessage

#
Gets or sets whether the info message indicator ought to be drawn.
public bool HasInfoMessage { get; set; }

HasInputPlugs

#
Gets whether any input plugs have been set.
public bool HasInputPlugs { get; }

HasOutputPlugs

#
Gets whether any output plugs have been set.
public bool HasOutputPlugs { get; }

HasWarningMessage

#
Gets or sets whether the warning message indicator ought to be drawn.
public bool HasWarningMessage { get; set; }

InputPlugCount

#
Gets the number of input plugs on this capsule.
public int InputPlugCount { get; }

OutputPlugCount

#
Gets the number of output plugs on this capsule.
public int OutputPlugCount { get; }

Slab

#
Get the geometry of the capsule shape.
public SlabF Slab { get; }

Methods

AddCustomPlug

#
Add a custom plug.
public void AddCustomPlug(
plug
Plugs to add.
)

AddInputPlug

#
Add an input plug at a given y-coordinate.
public void AddInputPlug(
yPosition,
Elevation of plug.
kind
Plugs kind.
)

AddOutputPlug

#
Add an output plug at a given y-coordinate.
public void AddOutputPlug(
yPosition,
Elevation of plug.
kind
Plugs kind.
)

CreateFromInner

#
Create a capsule from the inner (apex) bounds.
public static Capsule CreateFromInner(
Shape
shape,
Capsule shape.
RectangleF
innerBounds
Bounds of the apex face.
)

CreateFromOuter

#
Create a capsule from the outer bounds.
public static Capsule CreateFromOuter(
Shape
shape,
Capsule shape.
RectangleF
outerBounds
Outer bounds.
)

Draw

#
Draw this capsule into a graphics context.
public void Draw(
Graphics
graphics,
Graphics to draw with.
elements,
Capsule elements to draw.
shade,
Capsule shading.
skin
Optional grip skins.
)

Draw

#
Draw this capsule into a graphics context.
public void Draw(
Graphics
graphics,
Graphics to draw with.
shade,
Capsule shading.
skin
Optional grip skins.
)

DrawEdges

#
Draw the silhouette edges. This is typically the fifth and last part of the capsule drawing process, after DrawOverlay(Graphics, Skin, Shade).
public void DrawEdges(
Graphics
graphics,
skin,
shade
)

DrawFaces

#
Draw the apex and side faces. This is typically the second part of the capsule drawing process, after DrawGrips(Graphics, Skin).
public void DrawFaces(
Graphics
graphics,
skin,
shade
)

DrawGrips

#
Draw all grips. This is typically the first part of the capsule drawing process.
public void DrawGrips(
Graphics
graphics,
skin
)

DrawMessaging

#
Draw the messaging hints, if any. This is typically the third part of the capsule drawing process, after DrawFaces(Graphics, Skin, Shade).
public void DrawMessaging(
Graphics
graphics,
skin
)

DrawOverlay

#
Draw the overlay. This is typically the fourth part of the capsule drawing process, after DrawMessaging(Graphics, Skin).
public void DrawOverlay(
Graphics
graphics,
skin,
shade
)

InputPlug

#
Gets the input plug at the given index.
public Plug InputPlug(
index
Index of plug to retrieve.
)
Plugs at given index.

OutputPlug

#
Gets the output plug at the given index.
public Plug OutputPlug(
index
Index of plug to retrieve.
)
Plugs at given index.