Ejemplo n.º 1
0
        /// <summary>
        /// Processes IfcRoot attributes.
        /// </summary>
        /// <param name="ifcRoot">The IfcRoot handle.</param>
        protected override void Process(IFCAnyHandle ifcRoot)
        {
            base.Process(ifcRoot);

            GlobalId = IFCImportHandleUtil.GetRequiredStringAttribute(ifcRoot, "GlobalId", false);
            if (Importer.TheCache.CreatedGUIDs.Contains(GlobalId))
            {
                Importer.TheLog.LogWarning(Id, "Duplicate GUID: " + GlobalId, false);
            }
            else
            {
                Importer.TheCache.CreatedGUIDs.Add(GlobalId);
            }

            m_Name = IFCAnyHandleUtil.GetStringAttribute(ifcRoot, "Name");
            if (string.IsNullOrWhiteSpace(m_Name) && CreateNameIfNull())
            {
                m_Name = ifcRoot.TypeName;
            }
            m_Description = IFCAnyHandleUtil.GetStringAttribute(ifcRoot, "Description");

            IFCAnyHandle ownerHistoryHandle = IFCAnyHandleUtil.GetInstanceAttribute(ifcRoot, "OwnerHistory");

            if (IFCAnyHandleUtil.IsNullOrHasNoValue(ownerHistoryHandle))
            {
                if (IFCImportFile.TheFile.SchemaVersion < IFCSchemaVersion.IFC4)
                {
                    Importer.TheLog.LogWarning(Id, "Missing IfcOwnerHistory, ignoring.", true);
                }
            }
            else
            {
                m_OwnerHistory = IFCOwnerHistory.ProcessIFCOwnerHistory(ownerHistoryHandle);
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Processes IfcRoot attributes.
        /// </summary>
        /// <param name="ifcRoot">The IfcRoot handle.</param>
        protected override void Process(IFCAnyHandle ifcRoot)
        {
            base.Process(ifcRoot);

            GlobalId = IFCImportHandleUtil.GetRequiredStringAttribute(ifcRoot, "GlobalId", false);
            if (Importer.TheCache.CreatedGUIDs.Contains(GlobalId))
            {
                IFCImportFile.TheLog.LogWarning(Id, "Duplicate GUID: " + GlobalId, false);
            }
            else
            {
                Importer.TheCache.CreatedGUIDs.Add(GlobalId);
            }

            m_Name        = IFCAnyHandleUtil.GetStringAttribute(ifcRoot, "Name");
            m_Description = IFCAnyHandleUtil.GetStringAttribute(ifcRoot, "Description");

            IFCAnyHandle ownerHistoryHandle = IFCAnyHandleUtil.GetInstanceAttribute(ifcRoot, "OwnerHistory");

            m_OwnerHistory = IFCOwnerHistory.ProcessIFCOwnerHistory(ownerHistoryHandle);
        }