Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TugboatEng on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

ETABS API & Python - Cannot Attach to Existing Instance

Status
Not open for further replies.

Bjorn_Steinhagen

Structural
Joined
May 22, 2019
Messages
10
Location
ZA
Hi All,

Been trying to work with the ETABS API through Python. Majority of work will be done on existing ETABS models therefore trying to connect to existing instances of an ETABS model. When just trying to attach to a running instance of ETABS through Python I get the error:

AttributeError: module 'comtypes.gen.ETABSv17' has no attribute 'cOAPI'

This is strange as my colleague ran the exact same script on his PC and all worked fine and he could successfully work on ETABS models. Could anyone provide any insight on getting this to work? I have installed comtypes library.

Any help would be greatly appreciated.

Find Python script attached (straight copy and paste from the .chm help file).

Thanks!

 
 https://files.engineering.com/getfile.aspx?folder=9a3373b0-0303-4f15-a827-01a6970c7dee&file=ETABS_connect.py
please see my function for using the API with python. I had some trouble with 1 of the lines in the python module comtypes, I need to change 1 of the lines in the init file. Have a look thru, let me know how u go.
 
 https://files.engineering.com/getfile.aspx?folder=84b78bdf-005a-40bd-a89a-c063ebbf8e86&file=__init__.py
Thanks for the response! I still cannot seem to get things to work, could you kindly explain what you had to change in the init file? And why (just for my understanding). Thanks!
 
Won't comment on script itself since I'm no expert there. But you may want to consider bumping to ETABS v18. We've recently been developing some ETABS tools with Python and ETABS v17 was having some huge troubles with a lot of things. We bumped up to v18 and things are much smoother.

They made some big API improvements between v17 and v18.
 
I have gotten the API to work and already run into some shortcomings in terms of what can be scripted ... thanks for sharing the update regarding v18, I look forward to upgrading and checking it out!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top