Revit二次开发之载入族

载入族

此方法载入族无法覆盖原有族,即若存在相同名称的族则会载入失败

 1 Family family = null;  //族
 2 
 3 Transaction transaction = new Transaction(document); //事务
 4 
 5 transaction.Start("载入族");
 6 
 7 bool b = document.LoadFamily(path, out family); //载入族
 8 
 9 if (!b) { MessageBox.Show("请删除已有族"); }
10 
11 transaction.Commit();
12 
13 return family;

 

posted @ 2018-10-25 16:05  邢韬  阅读(2590)  评论(0编辑  收藏  举报