public static void LoadLinetype(string lineTypName, Database db, string lineTypeFile = null)
{
if (db == null)
{
db =Autodesk.AutoCAD.ApplicationServices.Application.DocumentManager.MdiActiveDocument.Database;
}
if (lineTypeFile == null || lineTypeFile.Trim().Length == 0)
{
lineTypeFile = "acadiso.lin";
}
using (Transaction acTrans = db.TransactionManager.StartTransaction())
{
LinetypeTable acLineTypTbl = acTrans.GetObject(db.LinetypeTableId, OpenMode.ForRead) as LinetypeTable;
if (acLineTypTbl.Has(lineTypName) == false)
{
db.LoadLineTypeFile(lineTypName, lineTypeFile);
}
acTrans.Commit();
}
}