Ejemplo n.º 1
0
        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);
            }
        }
Ejemplo n.º 2
0
        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);
            }
        }
Ejemplo n.º 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;
        }