/// <summary> /// 通过族名称获得该族 /// </summary> /// <param name="doc"></param> /// <param name="name"></param> /// <returns></returns> static public Family getFamilyByName(Document doc, String name) { ElementId foundId = null; existFamliyByName(doc, name, out foundId); Family fam = null; try { fam = foundId.getElementById(doc) as Family; } catch (Exception ex) { TaskDialog.Show("Error", ex.Message); } return(fam); }