public Xbim.CobieLiteUk.System mapSystem(IIfcSystem ifcSystem, Xbim.CobieLiteUk.System target)
        {
            target.ExternalEntity = Helper.ExternalEntityName(ifcSystem);
            target.ExternalId     = Helper.ExternalEntityIdentity(ifcSystem);
            target.AltExternalId  = ifcSystem.GlobalId;
            target.ExternalSystem = Helper.GetCreatingApplication(ifcSystem);
            target.Name           = ifcSystem.Name;
            target.Description    = ifcSystem.Description;
            target.Categories     = Helper.GetCategories(ifcSystem);
            target.Attributes     = Helper.GetAttributes(ifcSystem);

            IEnumerable <IIfcDocumentSelect> documentEnumerable = Helper.GetDocuments(ifcSystem);

            List <Document> documents = new List <Document>();
            List <string>   UsedNames = new List <string>();

            foreach (var ifcDocumentSelect in documentEnumerable)
            {
                if (ifcDocumentSelect is IIfcDocumentReference)
                {
                    var ifcDocumentReference = ifcDocumentSelect as IIfcDocumentReference;
                    if (ifcDocumentReference != null)
                    {
                        Document document = ConvertToDocument(ifcDocumentReference, ifcDocumentReference.ReferencedDocument, UsedNames);
                        documents.Add(document);
                    }
                }
            }

            target.Documents = documents;

            return(target);
        }
Example #2
0
        public SystemType(IIfcSystem ifcSystem, CoBieLiteHelper helper)
            : this()
        {
            externalEntityName = helper.ExternalEntityName(ifcSystem);
            externalID         = helper.ExternalEntityIdentity(ifcSystem);
            externalSystemName = helper.ExternalSystemName(ifcSystem);
            SystemName         = ifcSystem.Name;
            SystemDescription  = ifcSystem.Description;
            SystemCategory     = helper.GetClassification(ifcSystem);

            //Attributes
            var ifcAttributes = helper.GetAttributes(ifcSystem);

            if (ifcAttributes != null && ifcAttributes.Any())
            {
                SystemAttributes = new AttributeCollectionType {
                    Attribute = ifcAttributes
                }
            }
            ;

            //TODO:
            //System Issues
            //System Documents
        }
Example #3
0
        protected override Xbim.CobieLiteUk.System Mapping(IIfcSystem ifcSystem, Xbim.CobieLiteUk.System target)
        {
            var helper = ((IfcToCOBieLiteUkExchanger)Exchanger).Helper;

            target.ExternalEntity = helper.ExternalEntityName(ifcSystem);
            target.ExternalId     = helper.ExternalEntityIdentity(ifcSystem);
            target.AltExternalId  = ifcSystem.GlobalId;
            target.ExternalSystem = helper.ExternalSystemName(ifcSystem);
            target.Name           = ifcSystem.Name;
            target.Description    = ifcSystem.Description;
            target.CreatedBy      = helper.GetCreatedBy(ifcSystem);
            target.CreatedOn      = helper.GetCreatedOn(ifcSystem);
            target.Categories     = helper.GetCategories(ifcSystem);
            //Add Assets
            var systemAssignments    = helper.GetSystemAssignments(ifcSystem);
            var ifcObjectDefinitions = systemAssignments as IList <IIfcObjectDefinition> ?? systemAssignments.ToList();

            if (ifcObjectDefinitions.Any())
            {
                target.Components = new List <AssetKey>();
                foreach (var ifcObjectDefinition in ifcObjectDefinitions)
                {
                    var assetKey = new AssetKey {
                        Name = ifcObjectDefinition.Name
                    };
                    target.Components.Add(assetKey);
                }
            }

            //Attributes
            target.Attributes = helper.GetAttributes(ifcSystem);

            //Documents
            var docsMappings = Exchanger.GetOrCreateMappings <MappingIfcDocumentSelectToDocument>();

            helper.AddDocuments(docsMappings, target, ifcSystem);

            //TODO:
            //System Issues
            return(target);
        }
Example #4
0
 public SystemKeyType(IIfcSystem ifcSystem, CoBieLiteHelper helper)
 {
     SystemCategory      = helper.GetClassification(ifcSystem);
     SystemName          = ifcSystem.Name;
     externalIDReference = helper.ExternalEntityIdentity(ifcSystem);
 }