class AcDbLeader : public AcDbCurve;
The AcDbLeader class represents the LEADER entity within AutoCAD. Leaders are considered as dimensions in AutoCAD, which means they are controlled by dimension variable settings and dimension styles.
This class contains a dynamic array of points that are the vertices for the leader line. The first point in the array is the start of the leader. If the leader has an arrowhead it is located here. If the length of the first segment of the leader is less than twice the arrowhead size the arrowhead is suppressed. If the leader has an associated annotation object the last point of the leader is placed near it.
By default a leader has straight line segments, but it may be set to fit a spline to the vertexes.
Associativity between a leader and another object may be controlled by the methods attachAnnotation() and detachAnnotation(). Some editing methods will automatically break associativity, as described below.
To update the leader endpoint position relative to its associated annotation use the evaluateLeader() method.
The following persistent reactor notification functions are overridden by AcDbLeader to receive notification of changes in the associated annotation object, which has the leader object in its persistent reactor list:
This class overrides AcDbEntity::subSetDatabaseDefaults() to set the object's dimension style (dimstyle) to the current style for the database. Typically objects of this class are initialized with a call to setDatabaseDefaults() followed by a call to setDimstyleData() using data obtained by a call to AcDbDatabase::getDimstyleData().
If the leader is associated to an annotation object, the final end point of the leader is placed so as to attach to the annotation, that is the final point in the leader point array is ignored! This will happen automatically whenever the annotation object is edited so as to send out a modified() notification. You may also find that you must force it to happen sometimes by using AcDbLeader::evaluateLeader().
You can use the following test to determine if a leader has associated annotation:
bool hasNoAnno = pLeader->annotationObjId().isNull();