コード例 #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);
            }
        }
コード例 #2
0
ファイル: IFCRoot.cs プロジェクト: whztt07/RevitIFC
 /// <summary>
 /// Cleans out the IFCEntity to save memory.
 /// </summary>
 public virtual void CleanEntity()
 {
     GlobalId = null;
     m_Name = null;
     m_Description = null;
     m_OwnerHistory = null;
 }
コード例 #3
0
ファイル: IFCRoot.cs プロジェクト: whztt07/RevitIFC
 /// <summary>
 /// Cleans out the IFCEntity to save memory.
 /// </summary>
 public virtual void CleanEntity()
 {
     GlobalId       = null;
     m_Name         = null;
     m_Description  = null;
     m_OwnerHistory = null;
 }
コード例 #4
0
        /// <summary>
        /// Returns an IFCOwnerHistory object for an IfcOwnerHistory handle.
        /// </summary>
        /// <param name="ifcOwnerHistory">The IfcOwnerHistory handle.</param>
        /// <returns></returns>
        public static IFCOwnerHistory ProcessIFCOwnerHistory(IFCAnyHandle ifcOwnerHistory)
        {
            if (IFCAnyHandleUtil.IsNullOrHasNoValue(ifcOwnerHistory))
            {
                throw new ArgumentNullException("ifcOwnerHistory");
            }

            IFCEntity ownerHistory;

            if (!IFCImportFile.TheFile.EntityMap.TryGetValue(ifcOwnerHistory.StepId, out ownerHistory))
            {
                ownerHistory = new IFCOwnerHistory(ifcOwnerHistory);
            }
            return(ownerHistory as IFCOwnerHistory);
        }
コード例 #5
0
ファイル: IFCRoot.cs プロジェクト: whztt07/RevitIFC
        /// <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);
        }
コード例 #6
0
ファイル: IFCRoot.cs プロジェクト: whztt07/RevitIFC
        /// <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);
        }
コード例 #7
0
        /// <summary>
        /// Returns an IFCOwnerHistory object for an IfcOwnerHistory handle.
        /// </summary>
        /// <param name="ifcOwnerHistory">The IfcOwnerHistory handle.</param>
        /// <returns></returns>
        public static IFCOwnerHistory ProcessIFCOwnerHistory(IFCAnyHandle ifcOwnerHistory)
        {
            if (IFCAnyHandleUtil.IsNullOrHasNoValue(ifcOwnerHistory))
                throw new ArgumentNullException("ifcOwnerHistory");

            IFCEntity ownerHistory;
            if (!IFCImportFile.TheFile.EntityMap.TryGetValue(ifcOwnerHistory.StepId, out ownerHistory))
                ownerHistory = new IFCOwnerHistory(ifcOwnerHistory);
            return (ownerHistory as IFCOwnerHistory); 
        }