/// <summary> /// 加载指定线型文件中的指定名称的线型 /// </summary> /// <param name="lineTypName">线型名</param> /// <param name="db"></param> /// <param name="lineTypeFile">线型文件</param> 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();} }