sticksandtriangles
Structural
- Apr 7, 2015
- 490
I have been trying to make some upgrades to the section cut tool, mainly trying to prevent needless re-runs of the analysis if analysis has already run.
In doing this, I have checked to see if results are available, and if they are, I am skipping the run analysis call on the ETABs model. Skipping the run analysis function appears to be messing with applying edited tables for some reason.
My trouble comes in at these lines of code:
Again, when trying to skip Analyze.RunAnalysis() as shown in the conditional above, the _SapModel.DatabaseTables.ApplyEditedTables does not seem to be applied. There do not appear to be any errors in the ImportLog with the ApplyEdited.
Same appearance when working properly, but re-analysis required.
In addition, it perfectly acceptable in ETABs to create section cuts after the analysis is run and the model is locked. There should not be an issue with creating the section cuts at the end of the analysis from what I can tell.
File is up on github if you want to take a look at the code, ~line 635ish is where the code in question comes in.
I am guessing I am missing something simple, appreciate the second set of eyes!
S&T -
In doing this, I have checked to see if results are available, and if they are, I am skipping the run analysis call on the ETABs model. Skipping the run analysis function appears to be messing with applying edited tables for some reason.
My trouble comes in at these lines of code:
Code:
_SapModel.DatabaseTables.ApplyEditedTables(FillImportLog, ref NumFatalErrors, ref NumErrorMsgs, ref NumWarnMsgs, ref NumInfoMsgs, ref ImportLog);
DatabaseTableInfo databaseTableInfo = new DatabaseTableInfo();
databaseTableInfo.NumErrorMsgs = NumErrorMsgs;
databaseTableInfo.ImportLog = ImportLog;
//_SapModel.SetModelIsLocked(false);
//_SapModel.Analyze.RunAnalysis();
//Test if analysis needs to be run
string mySelectedCase = LoadCaseComBox.SelectedItem.ToString();
int index = LoadCaseList.FindIndex(x => x.MyName == mySelectedCase);
//If results are available, do not rerun the analysis.
if (LoadCaseList[index].Status != 4)
{
// Display the message box
MessageBox.Show("This requires you to rerun the analysis", "Rerun", MessageBoxButtons.OK, MessageBoxIcon.Warning);
_SapModel.GetModelIsLocked();
_SapModel.Analyze.RunAnalysis();
}
_SapModel.Results.Setup.DeselectAllCasesAndCombosForOutput();
_SapModel.Results.Setup.SetCaseSelectedForOutput(LoadCaseComBox.SelectedItem.ToString());
Again, when trying to skip Analyze.RunAnalysis() as shown in the conditional above, the _SapModel.DatabaseTables.ApplyEditedTables does not seem to be applied. There do not appear to be any errors in the ImportLog with the ApplyEdited.
Same appearance when working properly, but re-analysis required.
In addition, it perfectly acceptable in ETABs to create section cuts after the analysis is run and the model is locked. There should not be an issue with creating the section cuts at the end of the analysis from what I can tell.
File is up on github if you want to take a look at the code, ~line 635ish is where the code in question comes in.
I am guessing I am missing something simple, appreciate the second set of eyes!
S&T -