protected void LoadFamilyElements(Type familyType, FamilyNode family)
        {
            var products = from prod in _model.Instances.Where<IfcProduct>(p => p.GetType().IsAssignableFrom(familyType))
                           //orderby prod.Name
                           select prod;

            foreach (IfcProduct product in products)
            {
                ElementNode element = new ElementNode(product);
                family.Children.Add(element);
            }
        }
        protected void LoadFamilyElements(Type familyType, FamilyNode family)
        {
            var products = from prod in _model.Instances.Where <IfcProduct>(p => p.GetType().IsAssignableFrom(familyType))
                           //orderby prod.Name
                           select prod;

            foreach (IfcProduct product in products)
            {
                ElementNode element = new ElementNode(product);
                family.Children.Add(element);
            }
        }
Beispiel #3
0
        /// <summary>
        /// Groups all elements by their Family Type
        /// </summary>
        /// <returns></returns>
        private TreeNodes GetComponentStructure()
        {
            TreeNodes tree = new TreeNodes();

            var familyTypes = from t in GetFamilyElements() orderby t.Name select t;

            foreach (Type type in familyTypes)
            {
                FamilyNode family = new FamilyNode();
                family.Name = type.Name;

                LoadFamilyElements(type, family);

                tree.Add(family);
            }

            return(tree);
        }
        /// <summary>
        /// Groups all elements by their Family Type
        /// </summary>
        /// <returns></returns>
        private TreeNodes GetComponentStructure()
        {
            TreeNodes tree = new TreeNodes();

            var familyTypes = from t in GetFamilyElements() orderby t.Name select t;

            foreach (Type type in familyTypes)
            {
                FamilyNode family = new FamilyNode();
                family.Name = type.Name;

                LoadFamilyElements(type, family);

                tree.Add(family);
            }

            return tree;
        }