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); }