/// <summary> /// Create an IFCApplication object from a handle of type IfcApplication. /// </summary> /// <param name="ifcApplication">The IFC handle.</param> /// <returns>The IFCApplication object.</returns> public static IFCApplication ProcessIFCApplication(IFCAnyHandle ifcApplication) { if (IFCAnyHandleUtil.IsNullOrHasNoValue(ifcApplication)) { Importer.TheLog.LogNullError(IFCEntityType.IfcApplication); return(null); } IFCEntity application; if (!IFCImportFile.TheFile.EntityMap.TryGetValue(ifcApplication.StepId, out application)) { application = new IFCApplication(ifcApplication); } return(application as IFCApplication); }
/// <summary> /// Processes IfcOwnerHistory attributes. /// </summary> /// <param name="ifcOwnerHistory">The IfcOwnerHistory handle.</param> override protected void Process(IFCAnyHandle ifcOwnerHistory) { base.Process(ifcOwnerHistory); int? creationDate = IFCAnyHandleUtil.GetIntAttribute(ifcOwnerHistory, "CreationDate"); if (creationDate.HasValue) { // convert IFC seconds from 1/1/1970 to DateTime ticks since 1/1/1601. long ticks = ((long) creationDate.Value + 11644473600) * 10000000; m_CreationDate = new DateTime(ticks, DateTimeKind.Utc).AddYears(1600); } IFCAnyHandle owningApplication = IFCAnyHandleUtil.GetInstanceAttribute(ifcOwnerHistory, "OwningApplication"); if (IFCAnyHandleUtil.IsNullOrHasNoValue(owningApplication)) { Importer.TheLog.LogNullError(IFCEntityType.IfcApplication); return; } m_OwningApplication = IFCApplication.ProcessIFCApplication(owningApplication); }
/// <summary> /// Processes IfcOwnerHistory attributes. /// </summary> /// <param name="ifcOwnerHistory">The IfcOwnerHistory handle.</param> override protected void Process(IFCAnyHandle ifcOwnerHistory) { base.Process(ifcOwnerHistory); int?creationDate = IFCAnyHandleUtil.GetIntAttribute(ifcOwnerHistory, "CreationDate"); if (creationDate.HasValue) { // convert IFC seconds from 1/1/1970 to DateTime ticks since 1/1/1601. long ticks = ((long)creationDate.Value + 11644473600) * 10000000; m_CreationDate = new DateTime(ticks, DateTimeKind.Utc).AddYears(1600); } IFCAnyHandle owningApplication = IFCAnyHandleUtil.GetInstanceAttribute(ifcOwnerHistory, "OwningApplication"); if (IFCAnyHandleUtil.IsNullOrHasNoValue(owningApplication)) { IFCImportFile.TheLog.LogNullError(IFCEntityType.IfcApplication); return; } m_OwningApplication = IFCApplication.ProcessIFCApplication(owningApplication); }
/// <summary> /// Create an IFCApplication object from a handle of type IfcApplication. /// </summary> /// <param name="ifcApplication">The IFC handle.</param> /// <returns>The IFCApplication object.</returns> public static IFCApplication ProcessIFCApplication(IFCAnyHandle ifcApplication) { if (IFCAnyHandleUtil.IsNullOrHasNoValue(ifcApplication)) { IFCImportFile.TheLog.LogNullError(IFCEntityType.IfcApplication); return null; } IFCEntity application; if (!IFCImportFile.TheFile.EntityMap.TryGetValue(ifcApplication.StepId, out application)) application = new IFCApplication(ifcApplication); return (application as IFCApplication); }