//set CE element
DbElement CE = CurrentElement.Element;
//set a filter that filter the element with type == BRANCH
TypeFilter branFilter = new TypeFilter(DbElementTypeInstance.BRANCH);
//collecti all Bran in CE using above filter
DBElementCollection branCollection = new DBElementCollection(CE, branFilter);
//get all element in branch collection
foreach (DbElement branElement in branCollection)
{ //do something}
//set CE element
DbElement CE = CurrentElement.Element;
//set a filter that filter the element with type == BRANCH
TypeFilter branFilter = new TypeFilter(DbElementTypeInstance.BRANCH);
//collecti all Bran in CE using above filter
DBElementCollection branCollection = new DBElementCollection(CE, branFilter);
//get all element in branch collection
foreach (DbElement branElement in branCollection)
{ //do something}