1. 程式人生 > >Revit二次開發之載入族

Revit二次開發之載入族

return mes 刪除 開發 urn com tar 失敗 commit

載入族

此方法載入族無法覆蓋原有族,即若存在相同名稱的族則會載入失敗

 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;

Revit二次開發之載入族