using Autodesk.AutoCAD.Runtime;
using Autodesk.AutoCAD.ApplicationServices;
using Autodesk.AutoCAD.DatabaseServices;
/// <summary>
/// 加载acadiso.lin中的某种线型
/// </summary>
/// <param name="lineName">线型名称</param>
public static void LoadLinetype(string lineName)
{
Document acDoc = Application.DocumentManager.MdiActiveDocument;
Database acCurDb = acDoc.Database;
using (Transaction acTrans = acCurDb.TransactionManager.StartTransaction())
{
LinetypeTable acLineTypTbl = acTrans.GetObject(acCurDb.LinetypeTableId,OpenMode.ForRead) as LinetypeTable;
if (acLineTypTbl.Has(sLineTypName) == false)
{
// 加载acadiso.lin线型库中的线型,可以是acadiso.lin、acad.lin或者你自定义的线型库
acCurDb.LoadLineTypeFile(lineName, "acadiso.lin");
}
acTrans.Commit();
}
}
————————————————
版权声明:本文为CSDN博主「淡定vs冷漠」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/qq_21489689/article/details/78993737