private List <DbElement> CollectStructuralItems() { List <DbElement> dbElementList = new List <DbElement>(); DbElement element = CurrentElement.get_Element(); DbElementType[] dbElementTypeArray = new DbElementType[7] { (DbElementType)DbElementTypeInstance.SCTN, (DbElementType)DbElementTypeInstance.PANEL, (DbElementType)DbElementTypeInstance.GENSEC, (DbElementType)DbElementTypeInstance.FLOOR, (DbElementType)DbElementTypeInstance.GWALL, (DbElementType)DbElementTypeInstance.STWALL, (DbElementType)DbElementTypeInstance.WALL }; DBElementCollection elementCollection = new DBElementCollection(element); elementCollection.set_IncludeRoot(true); elementCollection.set_Filter((BaseFilter) new TypeFilter(dbElementTypeArray)); DBElementEnumerator enumerator = (DBElementEnumerator)elementCollection.GetEnumerator(); while (enumerator.MoveNext()) { dbElementList.Add((DbElement)enumerator.get_Current()); } return(dbElementList); }
private List <DbElement> CollectPrimitiveItems() { List <DbElement> dbElementList = new List <DbElement>(); try { DbElement element = CurrentElement.get_Element(); DbElementType[] dbElementTypeArray = new DbElementType[17] { (DbElementType)DbElementTypeInstance.BOX, (DbElementType)DbElementTypeInstance.CYLINDER, (DbElementType)DbElementTypeInstance.SLCYLINDER, (DbElementType)DbElementTypeInstance.RTORUS, (DbElementType)DbElementTypeInstance.CTORUS, (DbElementType)DbElementTypeInstance.POHEDRON, (DbElementType)DbElementTypeInstance.SNOUT, (DbElementType)DbElementTypeInstance.PYRAMID, (DbElementType)DbElementTypeInstance.POLYHEDRON, (DbElementType)DbElementTypeInstance.DISH, (DbElementType)DbElementTypeInstance.CONE, (DbElementType)DbElementTypeInstance.PCLAMP, (DbElementType)DbElementTypeInstance.HELEMENT, (DbElementType)DbElementTypeInstance.EXTRUSION, (DbElementType)DbElementTypeInstance.NOZZLE, (DbElementType)DbElementTypeInstance.SCLAMP, (DbElementType)DbElementTypeInstance.REVOLUTION }; DBElementCollection elementCollection = new DBElementCollection(element); elementCollection.set_IncludeRoot(true); elementCollection.set_Filter((BaseFilter) new TypeFilter(dbElementTypeArray)); DBElementEnumerator enumerator = (DBElementEnumerator)elementCollection.GetEnumerator(); while (enumerator.MoveNext()) { DbElement current = (DbElement)enumerator.get_Current(); if (Tools.CheckLevel(current, 6)) { dbElementList.Add(current); } } } catch (Exception ex) { HierarchyItem.Log.Error((object)("Error collecting primitives :" + ex.Message)); } return(dbElementList); }
private List <DbElement> CollectPjoiItems() { List <DbElement> dbElementList = new List <DbElement>(); DbElement element = CurrentElement.get_Element(); DbElementType[] dbElementTypeArray = new DbElementType[1] { (DbElementType)DbElementTypeInstance.PJOINT }; DBElementCollection elementCollection = new DBElementCollection(element); elementCollection.set_IncludeRoot(true); elementCollection.set_Filter((BaseFilter) new TypeFilter(dbElementTypeArray)); DBElementEnumerator enumerator = (DBElementEnumerator)elementCollection.GetEnumerator(); while (enumerator.MoveNext()) { dbElementList.Add((DbElement)enumerator.get_Current()); } return(dbElementList); }
//Create and iterate through collections public static void Run() { //Scan Nozzles below equi TypeFilter filt = new TypeFilter(DbElementTypeInstance.NOZZLE); DBElementCollection collection = new DBElementCollection(Example.Instance.mEqui, filt); DbAttribute att = DbAttributeInstance.FLNN; foreach (DbElement ele in collection) { Console.WriteLine(ele.GetAsString(att)); } //Scan branches below site DBElementCollection coll = new DBElementCollection(Example.Instance.mSite); coll.IncludeRoot = true; coll.Filter = new TypeFilter(DbElementTypeInstance.BRANCH); DBElementEnumerator iter = (DBElementEnumerator)coll.GetEnumerator(); while (iter.MoveNext()) { Console.WriteLine(iter.Current.ToString()); } }