/// <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); } }
/// <summary> /// Cleans out the IFCEntity to save memory. /// </summary> public virtual void CleanEntity() { GlobalId = null; m_Name = null; m_Description = null; m_OwnerHistory = null; }
/// <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); }
/// <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); }
/// <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); }
/// <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); }