5/17/24, 11:02 PM ETABs API - More Examples (Database Tables)
retug January 07, 2023
ETABs API - More Examples (Database Tables)
Sparked by a reddit inquiry, I have added an example on my github to access the database table results using the ETABs API. The python
code can be found on github.
The Code
The example code works to access the joint reaction database table results from ETABs v20.
In the image above, you can see that the python code pulls the correct vertical reaction when looking at the dead load reaction (3.177
kips). The python code returns results in pounds, but you can easily format your result units with SapModel.SetPresentUnits(x). The
ETABs API document gives a good run down on all the units available.
ETABs Python
https://re-tug.com/post/etabs-api-more-examples-database-tables/18 1/4
5/17/24, 11:02 PM ETABs API - More Examples (Database Tables)
Comments...Add Your Comment
khatran January 08, 2023
Your sharing is good. But I have an error when running the scripts. It happens when it tries to
"show all the available tables that can be accessed". I mean at this line:
x = SapModel.DatabaseTables.GetAvailableTables(NumberTables,TableKey, TableName, ImportType)
I also installed "comtype,clients". Please help figure out my issue, thank you.
Traceback (most recent call last):
File "D:\WORK\myPython\myapp\venv\lib\site-packages\comtypes\__init__.py", line 274, in __getattr__
fixed_name = self.__map_case__[name.lower()]
KeyError: 'databasetables'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "D:\WORK\myPython\EtabsApi\try\database.py", line 24, in <module>
x = SapModel.DatabaseTables.GetAvailableTables(NumberTables,TableKey, TableName, ImportType)
File "D:\WORK\myPython\myapp\venv\lib\site-packages\comtypes\__init__.py", line 276, in __getattr__
raise AttributeError(name)
AttributeError: DatabaseTables
retug January 09, 2023
@Khatran, what version of ETABs are you running?
Do the lines of code before x = SapModel.DatabaseTables.GetAvailableTables(...) work?
khatran January 10, 2023
Thank you for your reply, I am using Etabs 18.0.2. But the code runs well on another PC with Etabs 18.1.1
I have tried to uninstall and reinstall the comptypes.cilent but it still does not work.
I love making some small desktop app by using Etabs-Api, and your sharing helps me much. Thank again
retug January 10, 2023
I'm sorry for the trouble. I had a similar issue awhile back with ETABs 18 and it looks like others were having it as well.
The troubles went away when upgrading to ETABs 19.
https://www.eng-tips.com/viewthread.cfm?qid=477453
khatran January 11, 2023
Thank you, I have created an Etasb-Plugin, for Normalized Axial Force checking under seismic according to
Eurocode. I want to share it with you if you wish.
https://www.youtube.com/watch?v=_-8H5_eUNyQ&ab_channel=K-StructuralDesign
retug January 11, 2023
https://re-tug.com/post/etabs-api-more-examples-database-tables/18 2/4
5/17/24, 11:02 PM ETABs API - More Examples (Database Tables)
Khatran, that looks like a great program! Is that graphical user interface made with python or is that a C# addin for
ETABs? I want to explore making an addin with buttons natively in ETABs.
Throw the code up on github if you would like to share and drop a link in the comments, it would be great to see how
you coded this up.
khatran January 12, 2023
I wrote by vb.net (also possible by C# or python), then debug to a .dll file to use as Etabs plugin. I do not have GitHub
account, but I could send it to you by email if you want to.
I also have some tools to define multi-framing sections, materials, load patterns, and load combinations....
automatically (I have posted some videos on my channel). Even we could run it by VBA.
retug January 13, 2023
Good stuff khatran. Feel free to send to my email account.
https://www.re-tug.com/about/
khatran February 07, 2023
Hi, this is my new app for exporting column/wall to Prokon for design.
https://www.youtube.com/watch?v=7gnUCUN9sJM&ab_channel=K-StructuralDesign
rajavardhan April 12, 2024
Hi, I am not able to select frames and walls based on section properties in etabs v21 and then delete selected frames
and walls..can anyone suggest me the code to do it use Excel VBA code
retug April 14, 2024
Hi rajavardhan, are you not able to delete selected frames and walls based on section properties through the ETABs
program itself? Or through the API? I could put together a few quick examples for you with the API if needed.
Add Your Comment
Our Sidebar
You can put any information here you'd like.
Latest Comments
Liz_Larsen on R2R - Update V1.1.0 -
Great job! We've been wanting a tool like this for so long that I'd considered making it myself. During my research, I
stumbled across this blog right around the time you were looking for testers a few months ago.
I'll be sure to spread the word about this amazing tool. Thanks ...
retug on ETABs API - More Examples (Database Tables) -
https://re-tug.com/post/etabs-api-more-examples-database-tables/18 3/4
5/17/24, 11:02 PM ETABs API - More Examples (Database Tables)
Hi rajavardhan, are you not able to delete selected frames and walls based on section properties through the ETABs
program itself? Or through the API? I could put together a few quick examples for you with the API if needed.
rajavardhan on ETABs API - More Examples (Database Tables) -
Hi, I am not able to select frames and walls based on section properties in etabs v21 and then delete selected frames and
walls..can anyone suggest me the code to do it use Excel VBA code
https://re-tug.com/post/etabs-api-more-examples-database-tables/18 4/4