string FamilyName = "ชื่อ Family";
string FamilyPath = "c:/temp/ชื่อ Family.rfa";
Family family = FindElementByName( doc, typeof(Family), FamilyName) as Family;
if (family != null) return; //already exist
if (!File.Exists(FamilyPath))
{
MessageBox.Show(string.Format(
"Please ensure that the sample table "
+ "family file '{0}' exists in '{1}'.",
FamilyName, path));
return ;
}
// Load family from file:
using (Transaction tx = new Transaction(doc))
{
tx.Start("Load Family");
doc.LoadFamily(FamilyPath, out family);
tx.Commit();
}
ไม่มีความคิดเห็น:
แสดงความคิดเห็น