ETABs API Troubles - Section Cut Definition
ETABs API Troubles - Section Cut Definition
(OP)
Paging Jeremy Atkins, rscassar and maybe JoshPlum since I think he works at CSI. I made a diaphragm section cutting tool in python for ETABs and have documented the process here.
The python code worked in ETABs version 19, but does not work in ETABs version 20. I noticed some small tweaks to the database table for the section cut definitions and attempted some tweaks to the code to get it to work, but to no avail.
I have moved onto trying to code this in C# to make an addin in v20, but I am running into the same odd behavior with the database tables and I can not seem to fix it. I have posted the C# code on github if you want to review.
The code in question is in the Form1.cs file:
In the example above, I am trying make one section cut, based on the quadrilateral definition, with the four points being [0,10,0], [10,10,0], [10,10,1], [0,10,1].
The result of running this code creates (6) section cuts, all being defined by group and not quadrilateral, weird behavior.

The result that I am looking for would look something like this:

The data I have prepared to be input in the database table mimics this appearance, save the GUID first row last column. When I made the python script in v19, I just set this to "1" and it worked.
I also ran the GetTableForDisplayArray function to review the data output from ETABs and I cannot spot any difference in the data I am feeding the program verse what the program is returning.

If you have any ideas on how to resolve, in either python or C#, I would appreciate it. It's frustrating that I had it working in ETABs 19 and now I cannot get it to work.
Thanks!
S&T - www.re-tug.com
The python code worked in ETABs version 19, but does not work in ETABs version 20. I noticed some small tweaks to the database table for the section cut definitions and attempted some tweaks to the code to get it to work, but to no avail.
I have moved onto trying to code this in C# to make an addin in v20, but I am running into the same odd behavior with the database tables and I can not seem to fix it. I have posted the C# code on github if you want to review.
The code in question is in the Form1.cs file:
CODE --> C#
private void makeSectionCutBtn(object sender, EventArgs e) { string TableKey = "Section Cut Definitions"; //retrieving the table data review string[] FieldKeyList = new string[0]; string GroupName = ""; int TableVersion = 0; string[] FieldKeysIncluded = new string[0]; int NumberRecords = 0; string[] TableData = new string[0]; _SapModel.DatabaseTables.GetTableForDisplayArray(TableKey, ref FieldKeyList, GroupName, ref TableVersion, ref FieldKeysIncluded, ref NumberRecords, ref TableData); DatabaseTableResult resultsDatabaseTables = new DatabaseTableResult(); resultsDatabaseTables.FieldKeyList = FieldKeyList; resultsDatabaseTables.TableVersion = TableVersion; resultsDatabaseTables.FieldKeysIncluded = FieldKeysIncluded; resultsDatabaseTables.NumberRecords = NumberRecords; resultsDatabaseTables.TableData = TableData; //trying to createa custom section cut, not working string[] testETABs_Section_Cut_Data = new string[] { }; string[] teststring1 = new string [] { "0001", "Quads", "All", "Analysis", "Default", "0","0","0","Top or Right or Positive3","1", "1", "1", "0", "10", "0", "1" }; string[] teststring2 = new string[] { "0001", null , null, null, null, null, null, null, null, null, "1", "2", "10", "10", "0", null }; string[] teststring3 = new string[] { "0001", null, null,null, null, null, null, null, null,null, "1", "3", "10", "10", "1", null }; string[] teststring4 = new string[] { "0001", null, null,null, null, null, null, null, null,null, "1", "4", "0", "10", "1", null }; testETABs_Section_Cut_Data = teststring1.Concat(teststring2).ToArray(); testETABs_Section_Cut_Data = testETABs_Section_Cut_Data.Concat(teststring3).ToArray(); testETABs_Section_Cut_Data = testETABs_Section_Cut_Data.Concat(teststring4).ToArray(); int TableVersiontest = 1; string[] FieldKeysIncludedtest = new string[] {"Name", "Defined By", "Group","Result Type", "Result Location", "Rotation About Z", "Rotation About Y", "Rotation About X", "Element Side", "Number of Quads", "Quad Number", "Point Number", "Quad X", "Quad Y", "Quad Z", "GUID"}; int NumberRecordstest = 4; _SapModel.DatabaseTables.SetTableForEditingArray(TableKey, ref TableVersiontest, ref FieldKeysIncludedtest, NumberRecordstest, ref testETABs_Section_Cut_Data); bool FillImportLog = true; int NumFatalErrors = 0; int NumErrorMsgs = 0; int NumWarnMsgs = 0; int NumInfoMsgs = 0; string ImportLog = ""; _SapModel.DatabaseTables.ApplyEditedTables(FillImportLog,ref NumFatalErrors, ref NumErrorMsgs, ref NumWarnMsgs, ref NumInfoMsgs, ref ImportLog); }
In the example above, I am trying make one section cut, based on the quadrilateral definition, with the four points being [0,10,0], [10,10,0], [10,10,1], [0,10,1].
The result of running this code creates (6) section cuts, all being defined by group and not quadrilateral, weird behavior.

The result that I am looking for would look something like this:

The data I have prepared to be input in the database table mimics this appearance, save the GUID first row last column. When I made the python script in v19, I just set this to "1" and it worked.
I also ran the GetTableForDisplayArray function to review the data output from ETABs and I cannot spot any difference in the data I am feeding the program verse what the program is returning.

If you have any ideas on how to resolve, in either python or C#, I would appreciate it. It's frustrating that I had it working in ETABs 19 and now I cannot get it to work.
Thanks!
S&T - www.re-tug.com
RE: ETABs API Troubles - Section Cut Definition
CODE --> Text
I am not quite sure how to resolve this, one of the odds things I noticed when reviewing the database table was that the size of the table changes depending on how you define the section cut. If the section cut is defined by groups, the tables has 9 columns. If the table consists of either both groups and quadrilaterals or just quadrilaterals, there are 16 columns in the table.
Groups, 9 columns:
Quads or Groups and Quads, 16 columns:
I wish I still had access to ETABs v19 to see if this behavior was the same back in the day. It looks like our license no longer works for v19.
S&T - www.re-tug.com
RE: ETABs API Troubles - Section Cut Definition
When I get a chance, I'm going to take a look at the help file (CSI API ETABS v1.chm) for the version I'm using (the soon to be released v22). Hopefully, that will point me towards some changes that have been made with particular functions / calls that might explain your issue.
RE: ETABs API Troubles - Section Cut Definition
Thanks for the reply. I am guessing that there is something funky going on with the database tables as well in v20. You mentioned v22, is that v21? Any ideas on release date? Hopefully the new release might shine some light on this.
Playing a bit more, I was able to make section cut definitions based on groups, but still with some odd extra results.
CODE --> C#
Josh, do you have a contact at CSI that can assist with these sorts of questions? I do not really want to pay for the developer's program, but it would be nice to get this in the front of someone that can get this on the bug fix list if it is truly a bug.
S&T - www.re-tug.com
RE: ETABs API Troubles - Section Cut Definition
If I have some time this week I will grab your code off Github and try it out. Also, thanks for the shoutout on your post. Reminds me I should update it for v1 of the API
-JA
try Calcs.app and let me know what you think
RE: ETABs API Troubles - Section Cut Definition
Yes, sorry. I meant version 21. I'm currently working on a number of things for ASCE 7-22, so that 21 and 22 got conflated in my mind.
I don't have a release date for it. I not good at guessing this sort of thing, so I try not to. Personally, I feel like we're really getting close to an ETABS and SAFE v21 release.... To be perfectly honest, I've had that feeling for a couple of months now. It really just depends on the testing and validation for the main features. Sometimes this takes awhile for the bigger releases.
Also, I shouldn't give out contact information for developers on a forum like this. But, I will try to dig into some of our release notes / bug tickets to see what we've documented for ETABS for this v21 release. That way I can check to see if they cover the issue you're dealing with. I have a feeling they do.
RE: ETABs API Troubles - Section Cut Definition
Trained well I see
Easy enough to find my email address if you want to send it. Thanks for digging into it.
ggcdn, Thanks for the feedback as well. I will keep tinkering with a few more ideas, but I believe this to be a bug. The code worked in v19 and now does not.
S&T - www.re-tug.com
RE: ETABs API Troubles - Section Cut Definition
An example, you can see "Rotation About Z" in the visible column header has become "RotAboutZ" in the coded output.
Thanks Josh and ggcdn
S&T - www.re-tug.com