/// <summary> /// Get the file directory/location /// </summary> /// <param name="ifcDocumentReference">Document Reference Object</param> /// <returns>string</returns> private static string GetFileDirectory(IIfcExternalReference ifcDocumentReference) { if (ifcDocumentReference == null) { return(null); } if (!string.IsNullOrEmpty(ifcDocumentReference.Location)) { return(ifcDocumentReference.Location); } return(null); }
/// <summary> /// Get Name from IfcDocumentReference /// </summary> /// <param name="ifcDocumentReference">Document Reference Object</param> /// <returns>string or null</returns> private static string GetName(IIfcExternalReference ifcDocumentReference) { if (ifcDocumentReference == null) { return(null); } if (!string.IsNullOrEmpty(ifcDocumentReference.Name)) { return(ifcDocumentReference.Name); } if (!string.IsNullOrEmpty(ifcDocumentReference.Location)) { return(Path.GetFileNameWithoutExtension(ifcDocumentReference.Location)); } //we ignore ItemReference, "which refers to a system interpretable position within the document" //from http://www.buildingsmart-tech.org/ifc/IFC2x3/TC1/html/ifcexternalreferenceresource/lexical/ifcdocumentreference.htm return(null); }