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

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

@Khatran, what version of ETABs are you running?

Do the lines of code before x = SapModel.DatabaseTables.GetAvailableTables(...) work?

 

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

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. smiley

 https://www.youtube.com/watch?v=_-8H5_eUNyQ&ab_channel=K-StructuralDesign

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.

 

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.

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

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 

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.

Our Sidebar

You can put any information here you'd like.

  • Latest Comments
  • retug on 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 

  • retug on SAP2000 API Example -

    Thanks James, appreciate you taking a look at the blog.

    The stuff you have been making is really cool too, always happy to see more people making coding more approachable for the practicing structural engineer.

    The package you linked for SAP2000 looks good, I will have to check it out.