ETABs API Database Tables - Apply Changes While Model is Locked
ETABs API Database Tables - Apply Changes While Model is Locked
(OP)
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.
https://github.com/retug/SectionCutter/blob/main/F...
I am guessing I am missing something simple, appreciate the second set of eyes!
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 --> C#
_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.
https://github.com/retug/SectionCutter/blob/main/F...
I am guessing I am missing something simple, appreciate the second set of eyes!
S&T - www.re-tug.com
RE: ETABs API Database Tables - Apply Changes While Model is Locked
You can do add section cut through regular user interface with the model being locked,
In addition, the function returns 0 which means it was able to execute correctly, but that database table is not edited.
As I am typing this, I think I found the problem.
With the model unlocked, you have the following interactive tables available for editing through the typical GUI:
But, when the model is locked, this table disappears:
Seems like it should be available for editing even when locked.
S&T - www.re-tug.com