PPT_LOGO_4b
Revit Programming Introduction <#>
Copyright © 2009 Autodesk Inc.
ファミリーイテレーション
•List<Element> families = new List<Element>();
•Filter filterFamily = app.Create.Filter.NewTypeFilter( typeof( Family ) );
•doc.get_Elements( filterFamily, families );
•string sMsg = "Standard families already loaded in this model:";
•foreach( Family f in families )
•{
•  // Get its category name; notice that the Category property is not
•  // implemented for the Family class; use FamilyCategory instead;
•  // notice that that is also not always implemented; in that case,
•  // use the workaround demonstrated below, looking at the contained
•  // family symbols' category:
•  sMsg += "\r\n  Name=" + f.Name
•    + "; Category=" + ( ( null == f.Category ) ? "?" : f.Category.Name )
•    + "; FamilyCategory=" + ( ( null == f.FamilyCategory ) ? "?" : f.FamilyCategory.Name );
•}
•LabUtils.InfoMsg( sMsg );
–
§Categoryプロパティは常に未実装
§FamilyCategory プロパティは未実装の場合あり
ファミリーとタイプ
Labs_3_1_01.png
先のダイアグラムで説明しましたが、ファミリーは色々なタイプ(シンボル)の入れ物ですの。
ここでは、ドキュメント中の入れ物を全て取得、カテゴリや名前を表示しています。