diff --git a/FemDesign.Grasshopper/Model/ModelReadFromFile.cs b/FemDesign.Grasshopper/Model/ModelReadFromFile.cs index 6c4d6900e..cfd8d4bca 100644 --- a/FemDesign.Grasshopper/Model/ModelReadFromFile.cs +++ b/FemDesign.Grasshopper/Model/ModelReadFromFile.cs @@ -29,18 +29,29 @@ protected override void SolveInstance(IGH_DataAccess DA) { // get indata string filePath = null; - if (!DA.GetData(0, ref filePath)) + DA.GetData(0, ref filePath); + + + if (_FileName.IsASCII(filePath)) + this.AddRuntimeMessage(GH_RuntimeMessageLevel.Warning, "File path has special characters. This might cause problems."); + + + bool fileExist = OnPingDocument().IsFilePathDefined; + if (!fileExist) { - return; + // hops issue + //var folderPath = System.IO.Directory.GetCurrentDirectory(); + string tempPath = System.IO.Path.GetTempPath(); + System.IO.Directory.SetCurrentDirectory(tempPath); } - - if (filePath == null) + else { - return; + filePath = OnPingDocument().FilePath; + var currentDir = System.IO.Path.GetDirectoryName(filePath); + System.IO.Directory.SetCurrentDirectory(currentDir); } - if (_FileName.IsASCII(filePath)) - this.AddRuntimeMessage(GH_RuntimeMessageLevel.Warning, "File path has special characters. This might cause problems."); + Model model = null;