引出線は図面上の任意の点またはフィーチャから作成でき、その外観をコントロールできます。引出線には、線分セグメントまたは滑らかなスプライン曲線を使用することができます。引出線の色は、現在の寸法線の色により決定されます。引出線の尺度は、現在の寸法スタイルで設定された寸法図形全体の尺度により決定されます。矢印がある場合は、その種類および大きさは、現在の寸法スタイルで定義されている矢印により決定されます。
フック ラインという短い線は、通常は注釈と引出線を結びます。フック ラインは、最後の引出線セグメントと水平線の角度が 15 度よりも大きい場合に、マルチ テキストおよび公差記入枠とともに表示されます。フック ラインは、矢印 1 つ分の長さになります。引出線に注釈がない場合は、フック ラインは描画されません。

引出線を作成するには、Leader オブジェクトのインスタンスを作成します。Leader オブジェクトのインスタンスを作成する際に、そのコンストラクタでパラメータを使用することはできません。AppendVertex メソッドは、作成した引出線の位置と長さを定義するために使用します。
次の例は、モデル空間に引出線を記入します。引出線と関連付けられる注釈はありません。
Imports Autodesk.AutoCAD.Runtime
Imports Autodesk.AutoCAD.ApplicationServices
Imports Autodesk.AutoCAD.DatabaseServices
Imports Autodesk.AutoCAD.Geometry
<CommandMethod("CreateLeader")> _
Public Sub CreateLeader()
'' Get the current database
Dim acDoc As Document = Application.DocumentManager.MdiActiveDocument
Dim acCurDb As Database = acDoc.Database
'' Start a transaction
Using acTrans As Transaction = acCurDb.TransactionManager.StartTransaction()
'' Open the Block table for read
Dim acBlkTbl As BlockTable
acBlkTbl = acTrans.GetObject(acCurDb.BlockTableId, _
OpenMode.ForRead)
'' Open the Block table record Model space for write
Dim acBlkTblRec As BlockTableRecord
acBlkTblRec = acTrans.GetObject(acBlkTbl(BlockTableRecord.ModelSpace), _
OpenMode.ForWrite)
'' Create the leader
Using acLdr As Leader = New Leader()
acLdr.AppendVertex(New Point3d(0, 0, 0))
acLdr.AppendVertex(New Point3d(4, 4, 0))
acLdr.AppendVertex(New Point3d(4, 5, 0))
acLdr.HasArrowHead = True
'' Add the new object to Model space and the transaction
acBlkTblRec.AppendEntity(acLdr)
acTrans.AddNewlyCreatedDBObject(acLdr, True)
End Using
'' Commit the changes and dispose of the transaction
acTrans.Commit()
End Using
End Sub
using Autodesk.AutoCAD.Runtime;
using Autodesk.AutoCAD.ApplicationServices;
using Autodesk.AutoCAD.DatabaseServices;
using Autodesk.AutoCAD.Geometry;
[CommandMethod("CreateLeader")]
public static void CreateLeader()
{
// Get the current database
Document acDoc = Application.DocumentManager.MdiActiveDocument;
Database acCurDb = acDoc.Database;
// Start a transaction
using (Transaction acTrans = acCurDb.TransactionManager.StartTransaction())
{
// Open the Block table for read
BlockTable acBlkTbl;
acBlkTbl = acTrans.GetObject(acCurDb.BlockTableId,
OpenMode.ForRead) as BlockTable;
// Open the Block table record Model space for write
BlockTableRecord acBlkTblRec;
acBlkTblRec = acTrans.GetObject(acBlkTbl[BlockTableRecord.ModelSpace],
OpenMode.ForWrite) as BlockTableRecord;
// Create the leader
using (Leader acLdr = new Leader())
{
acLdr.AppendVertex(new Point3d(0, 0, 0));
acLdr.AppendVertex(new Point3d(4, 4, 0));
acLdr.AppendVertex(new Point3d(4, 5, 0));
acLdr.HasArrowHead = true;
// Add the new object to Model space and the transaction
acBlkTblRec.AppendEntity(acLdr);
acTrans.AddNewlyCreatedDBObject(acLdr, true);
}
// Commit the changes and dispose of the transaction
acTrans.Commit();
}
}
Sub CreateLeader()
Dim leaderObj As AcadLeader
Dim points(0 To 8) As Double
Dim leaderType As Integer
Dim annotationObject As AcadObject
points(0) = 0: points(1) = 0: points(2) = 0
points(3) = 4: points(4) = 4: points(5) = 0
points(6) = 4: points(7) = 5: points(8) = 0
leaderType = acLineWithArrow
Set annotationObject = Nothing
' Create the leader object in model space
Set leaderObj = ThisDrawing.ModelSpace. _
AddLeader(points, annotationObject, leaderType)
ZoomAll
End Sub