How should I change?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Revit 2008 API
private void GetWallOpenInfo()
{
// 창문을 구한다.
Document doc = _commandData.Application.ActiveDocument;
ElementFilterIterator eIter = doc.get_Elements(typeof(FamilyInstance));
_wallOpenInfo = new Dictionary<FamilyInstance, string>();
while (eIter.MoveNext())
{
FamilyInstance family = eIter.Current as FamilyInstance;
if (family.Category.Equals(doc.Settings.Categories.get_Item(BuiltInCategory.OST_Doors)) ||
family.Category.Equals(doc.Settings.Categories.get_Item(BuiltInCategory.OST_Windows)))
{
if (!_wallOpenInfo.ContainsKey(family))
_wallOpenInfo.Add(family, family.Host.UniqueId);
}
}
}
2014 Revit API
private void GetWallOpenInfo()
{
// 창문을 구한다.
Document doc = _commandData.Application.ActiveUIDocument.Document;
//ElementFilterIterator eIter = doc.get_Elements(typeof(FamilyInstance));
FilteredElementIterator eIter = doc.GetElement(typeof(FamilyInstance));
_wallOpenInfo = new Dictionary<FamilyInstance, string>();
while (eIter.MoveNext())
{
FamilyInstance family = eIter.Current as FamilyInstance;
if (family.Category.Equals(doc.Settings.Categories.get_Item(BuiltInCategory.OST_Doors)) ||
family.Category.Equals(doc.Settings.Categories.get_Item(BuiltInCategory.OST_Windows)))
{
if (!_wallOpenInfo.ContainsKey(family))
_wallOpenInfo.Add(family, family.Host.UniqueId);
}
}
}
How should I change?