public async Task <OperationResult> IfcToWexbim(string uuid) { var source = uuid + ".ifc"; var destination = Guid.NewGuid() + ".wexbim"; var stream = _wexbimConverterService.ConvertAsync(source, destination); var operationResult = new OperationResult(); operationResult.fileName = destination; return(operationResult); }
public async Task <IActionResult> ConvertFromIfcGeometry(IFormFile ifcFile) { if (ifcFile == null) { return(BadRequest()); } try { using (var ifcStream = ifcFile.OpenReadStream()) { var wexbimConverter = new WexbimConverterService(); var wexBimStream = await wexbimConverter.ConvertAsync(ifcStream); return(File(wexBimStream, "application/octet-stream", "model.wexbim")); } } catch { // The conversion failed return(BadRequest()); } }