private void GetTitleBlocks(Document doc)
{
var tmp = new FilteredElementCollector(doc).OfClass(typeof(FamilySymbol)).OfCategory(BuiltInCategory.OST_TitleBlocks).Cast<FamilySymbol>();
m_allTitleBlocks = new HashSet<FamilySymbol>(tmp);
if (0 == m_allTitleBlocks.Count())
{
throw new Exception("There is no title block to generate sheet.");
}
foreach (FamilySymbol f in m_allTitleBlocks) {
m_titleBlockNames.Add(f.Name);
if (null == m_titleBlock) {
m_titleBlock = f;
}
}
}