DisplayPen

References
public class DisplayPen
Pen used to define stroke applied to several DisplayPipeline draw functions

Properties

CapStyle

#Since v8.0
public LineCapStyle CapStyle { get; set; }
How caps are drawn at the ends of open curves

Color

#Since v8.0
public Color Color { get; set; }
Color applied to stroke

HaloColor

#Since v8.0
public Color HaloColor { get; set; }
Halos are blended colors drawn around a curve for purposes like selection

HaloThickness

#Since v8.0
public float HaloThickness { get; set; }
Halos are blended colors drawn around a curve for purposes like selection

JoinStyle

#Since v8.0
public LineJoinStyle JoinStyle { get; set; }
How corners of curves are joined

PatternAutoscale

#Since v9.0
public bool PatternAutoscale { get; set; }
Scale pattern in detail views

PatternBySegment

#Since v8.0
public bool PatternBySegment { get; set; }
Restart patterns at corners in a curve

PatternLengthInWorldUnits

#Since v8.0
public bool PatternLengthInWorldUnits { get; set; }
If true, lengths in pattern definition are interpreted to be in world units. If false, screen pixel distances are used.

PatternOffset

#Since v8.0
public float PatternOffset { get; set; }
Offset to apply to pattern. If RhinoMath.UnsetSingle, then pattern is centered to keep even dash lengths at ends

PatternScale

#Since v9.0
public float PatternScale { get; set; }
Scale applied to the pattern, use 0.0 to let Rhino apply global scale.

Thickness

#Since v8.0
public float Thickness { get; set; }
Thickness for stroke

ThicknessSpace

#Since v8.0
public CoordinateSystem ThicknessSpace { get; set; }
Coordinate system for the pen's thickness

Methods

Duplicate

#Since v8.0
public DisplayPen Duplicate()
Create a duplicate of this display pen.
An exact duplicate of this display pen.

FromLinetype

#Since v8.0
public static DisplayPen FromLinetype(Linetype linetype, Color color, double patternScale)
Create a display pen that matches a linetype definition
linetype (Linetype)
color (Color)
patternScale (double)scale to be applied to linetype dash pattern. Typically this is 1.0.

FromLinetype

#Since v9.0
public static DisplayPen FromLinetype(Linetype linetype, Color color)
Create a display pen that matches a linetype definition on any viewport.
linetype (Linetype)
color (Color)

PatternAsArray

#Since v8.0
public float[] PatternAsArray()
Get the pattern for this pen as an array of dash,gap,dash,gap... values

SetPattern

#Since v8.0
public void SetPattern(IEnumerable<float> dashesAndGaps)
Set pattern to apply for a stroke.
dashesAndGaps (IEnumerable<float>)Lengths of dashes and gaps for a pattern. Dash is always assumed the first item. There is a limit to 8 dashes and gaps total
ArgumentOutOfRangeExceptionthrown when dashes and gaps have more than 8 items

SetTaper

#Since v8.0
public void SetTaper(float startThickness, float endThickness, Point2f taperPoint)
Positions and thickness at those positions along a curve that define a taper.
startThickness (float)
endThickness (float)
taperPoint (Point2f)

TaperAsArray

#Since v8.0
public Point2f[] TaperAsArray()
Collection of positions and thicknesses at those positions to define a taper Rhino currently only supports either no taper or a single taper. An array is used here in case Rhino supports multiple taper values in the future.