線種に説明を付けることができます。これは、線種を ASCII 文字で表現したものです。AsciiDescription プロパティを使用すると、線種の説明を割り当てたり変更することができます。
線種の説明は、最大 47 文字です。説明には、コメントまたは線種パターンを簡潔に示す一連のアンダースコア(_)、ドット(.)、ダッシュ(-)、スペースを入力できます。
次の例では、現在の線種の説明を変更します。
using Autodesk.AutoCAD.Runtime;
using Autodesk.AutoCAD.ApplicationServices;
using Autodesk.AutoCAD.DatabaseServices;
[CommandMethod("ChangeLinetypeDescription")]
public static void ChangeLinetypeDescription()
{
// Get the current document and database
Document acDoc = Application.DocumentManager.MdiActiveDocument;
Database acCurDb = acDoc.Database;
// Start a transaction
using (Transaction acTrans = acCurDb.TransactionManager.StartTransaction())
{
// Open the Linetype table record of the current linetype for write
LinetypeTableRecord acLineTypTblRec;
acLineTypTblRec = acTrans.GetObject(acCurDb.Celtype,
OpenMode.ForWrite) as LinetypeTableRecord;
// Change the description of the current linetype
acLineTypTblRec.AsciiDescription = "Exterior Wall";
// Save the changes and dispose of the transaction
acTrans.Commit();
}
}