Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

ETABs API Database Tables - Apply Changes While Model is Locked

Status
Not open for further replies.

sticksandtriangles

Structural
Apr 7, 2015
468
0
16
US
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:

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.

image_wbkx8k.png


Same appearance when working properly, but re-analysis required.

image2_hjnmxz.png


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 -
 
Replies continue below

Recommended for you

A little more info, applyedited tables seems to acknowledge that only some tables are editable.

applyeditted_te0it6.png


You can do add section cut through regular user interface with the model being locked,
testimage_e5rpkm.png


add_section_cut_pqbvy0.png


In addition, the function returns 0 which means it was able to execute correctly, but that database table is not edited.

image4_divzrh.png


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:

unlock_ccyuex.png


But, when the model is locked, this table disappears:

locked_xai5u4.png


Seems like it should be available for editing even when locked.



S&T -
 
Status
Not open for further replies.
Back
Top