This brief guide demonstrates how to an annotation leader using C/C++.

## How To

Leaders in Rhino are defined by the ON_Leader2 class. To construct a leader, you must provide:

1. A plane, or an ON_Plane object, which defines the plane in which the leader will be located.
2. Two or more 2D points that line in the plane that you specified above.

In the following sample code, we will construct a simple leader object. The leader will reside in the world x-y plane and will have four points…

CRhinoCommand::result CCommandLeader::RunCommand( const CRhinoCommandContext& context )
{
// Some set of points that define the leader
ON_3dPointArray points;
points.Append( ON_3dPoint(1.0, 1.0, 0.0) );
points.Append( ON_3dPoint(5.0, 1.0, 0.0) );
points.Append( ON_3dPoint(5.0, 5.0, 0.0) );
points.Append( ON_3dPoint(9.0, 5.0, 0.0) );

// The plane in which the leader resides
ON_Plane plane = ON_xy_plane;

int i;
for( i = 0; i < points.Count(); i++ )
{
// Make sure the points are on the plane
ON_2dPoint p2;
{
}
}