Пример #1
0
        public static CcManufacturerProduct LoadProductDataTemplate(string key, string classificationCode)
        {
            IfcProject            ifcProject            = Workspace.Current.Documents[key].Project;
            CcManufacturerProduct ccProductDataTemplate = new CcManufacturerProduct(classificationCode);

            return(ccProductDataTemplate);
        }
        private static CcManufacturerProduct GetProductFromPset(Document document, IfcPropertySet pset)
        {
            CcManufacturerProduct prd = null;

            var reldefprop = document.IfcXmlDocument.Items.OfType <IfcRelDefinesByProperties>();

            //.Where(ele => ele.RelatingPropertyDefinition.Item..RelatingTemplate.Ref == pset.Id);

            foreach (IfcRelDefinesByProperties reldef in reldefprop)
            {
                IfcPropertySet settemp = reldef.RelatingPropertyDefinition.Item as IfcPropertySet;
                if (settemp != null && settemp.Ref == pset.Id)
                {
                    var relobj = document.IfcXmlDocument.Items.OfType <IfcElement>()
                                 .Where(ele => ele.Id == reldef.RelatedObjects.Ref);

                    List <IfcElement> eles = relobj.ToList();
                    if (eles != null && eles.Count > 0)
                    {
                        prd             = new CcManufacturerProduct();
                        prd.Name        = eles[0].Name;
                        prd.Description = eles[0].Description;
                        break;
                    }
                }
            }

            return(prd);
        }
        private static List <CcManufacturerProduct> GetListOfManufacturerProducts(Document doc, List <IfcPropertySet> psets, string code)
        {
            List <CcManufacturerProduct> lstproducts = new List <CcManufacturerProduct>();

            foreach (IfcPropertySet pset in psets)
            {
                CcManufacturerProduct prd = GetProductFromPset(doc, pset);
                if (prd != null)
                {
                    prd.Code = code;
                    prd.Attributes.AddRange(GetAttributesForProduct(doc, pset));
                    lstproducts.Add(prd);
                }
            }
            return(lstproducts);
        }
Пример #4
0
 public static void AddManufacturerProductToFile(string key, CcManufacturerProduct ccProduct)
 {
     //check if site exists, if not add the first which IFC requires
 }
Пример #5
0
        public static CcManufacturerProduct LoadProductDataTemplate(string key, string classificationCode)
        {
            CcManufacturerProduct ccProductDataTemplate = new CcManufacturerProduct(classificationCode);

            return(ccProductDataTemplate);
        }