Skip to content

Commit

Permalink
🐛 working directory
Browse files Browse the repository at this point in the history
  • Loading branch information
Marco-Pellegrino committed Oct 21, 2024
1 parent b2dbf28 commit db17efb
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 5 deletions.
4 changes: 0 additions & 4 deletions FemDesign.Core/FemDesignConnection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1016,10 +1016,6 @@ public FemDesign.Results.InteractionSurface RunInteractionSurface(FemDesign.Bars

public void LoadGroupToLoadComb(bool fu = true, bool fua = true, bool fus = true, bool fsq = true, bool fsf = true, bool fsc = true, bool fSeisSigned = true, bool fSeisTorsion = true, bool fSeisZdir = true, bool fSkipMinDL = true, bool fForceTemp = true, bool fShortName = true)
{
var version = Int32.Parse(this._process.MainModule.FileVersionInfo.FileVersion.Replace(".", ""), CultureInfo.InvariantCulture);
if (version < 22040)
throw new Exception("FEM-Design 22.00.004 or greater is required!");

var cmdLoadGroupToLoadComb = new CmdLoadGroupToLoadComb(fu, fua, fus, fsq, fsf, fsc, fSeisSigned, fSeisTorsion, fSeisZdir, fSkipMinDL, fForceTemp, fShortName);

string logfile = OutputFileHelper.GetLogfilePath(OutputDir);
Expand Down
21 changes: 20 additions & 1 deletion FemDesign.Grasshopper/Loads/Load groups/LoadGroupToLoadComb.cs
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,29 @@ protected override void SolveInstance(IGH_DataAccess DA)

var loadCombinations = new List<FemDesign.Loads.LoadCombination>();


#region Set Current Directory
bool fileExist = OnPingDocument().IsFilePathDefined;
if (!fileExist)
{
// hops issue
//var folderPath = System.IO.Directory.GetCurrentDirectory();
string tempPath = System.IO.Path.GetTempPath();
System.IO.Directory.SetCurrentDirectory(tempPath);
}
else
{
var filePath = OnPingDocument().FilePath;
var currentDir = System.IO.Path.GetDirectoryName(filePath);
System.IO.Directory.SetCurrentDirectory(currentDir);
}
#endregion


// Create Task
var t = Task.Run(() =>
{
var connection = new FemDesignConnection(minimized: true, tempOutputDir: false);
var connection = new FemDesignConnection(minimized: true);

var model = new Model(countryCode, loadCases: _loadCases, loadGroups: loadGroups);
model.Entities.Loads.LoadGroupTable.SimpleCombinationMethod = _combinationMethod;
Expand Down

0 comments on commit db17efb

Please sign in to comment.