×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

ETABS API Python "Analysis Result"

ETABS API Python "Analysis Result"

ETABS API Python "Analysis Result"

(OP)
Hello, I am connecting to etabse and using the combination I chose. I want to write a code that will get "frame forces" data from the "analysis result" section. I wrote a code, it connects to etabse and pulls the combinations correctly, but the frame force data does not appear. Can you help me where is my mistake? Did I share the code and its output?
import comtypes.client

class EtabsColumnForcesConsole:
def __init__(self):
self.ETABSObject = None
self.SapModel = None
self.connected = False

def connect_to_etabs(self):
try:
self.ETABSObject = comtypes.client.GetActiveObject("CSI.ETABS.API.ETABSObject")
self.SapModel = self.ETABSObject.SapModel
self.connected = True
except Exception as e:
print("Etabs connection error:", str(e))
self.connected = False

self.update_connection_status()

def update_combination_names(self):
combinations = self.get_etabs_combinations()
if combinations:
print("Combinations:", combinations)

def get_etabs_combinations(self):
try:
ret_combinations = self.SapModel.RespCombo.GetNameList()
combination_names = [item for item in ret_combinations[1]]
return combination_names
except Exception as e:
print("ETABS connection error:", str(e))
return None

def update_connection_status(self):
if self.connected:
print("Connection Status: Connected")
else:
print("Connection Status: Not Connected")

def get_column_forces_data(self, combination):
if not self.connected:
print("Warning: No connection to ETABS.")
return

try:
print("Selected Combination:", combination)
self.SapModel.Results.Setup.SetComboSelectedForOutput(combination, True)
print("Combination successfully selected")

ret_column_forces = self.SapModel.Results.FrameForce("ALL", 0, 0, [], [], [], [], [], [], [], [], [], [], [], [], [])
print("FrameForce data successfully retrieved")

# Print the retrieved data
print("Retrieved Data:")
for i, load_case in enumerate(ret_column_forces[7]):
print(f"Load Case: {load_case}, P: {ret_column_forces[8][i]}, V2: {ret_column_forces[9][i]}, V3: {ret_column_forces[10][i]}, T: {ret_column_forces[11][i]}, M2: {ret_column_forces[12][i]}, M3: {ret_column_forces[13][i]}")

except Exception as e:
print("Column Forces data retrieval error:", str(e))
print("Warning: An error occurred while retrieving Column Forces data.")

def run(self):
self.connect_to_etabs()
self.update_combination_names()
combination = input("Combination Name: ")
self.get_column_forces_data(combination)


if __name__ == "__main__":
app = EtabsColumnForcesConsole()
app.run()
OUTPUT:
Connection Status: Connected
Combinations: ['USTX', 'USTY', 'DUSTX', 'DUSTY', 'DALTX', 'DALTY', 'DUSTVTABANX', 'DUSTVTABANY', 'EDZ', 'GT', 'AGIRLIK', 'QT', '14G16Q16S', '14G16Q', 'USTSUNEKDEP1', 'USTSUNEKDEP2', 'USTSUNEKDEP3', 'USTSUNEKDEP4', 'USTGEVREKDEP1', 'USTGEVREKDEP2', 'USTGEVREKDEP3', 'USTGEVREKDEP4', 'ALTSUNEKDEP1', 'ALTSUNEKDEP2', 'ALTSUNEKDEP3', 'ALTSUNEKDEP4', 'ALTSUNEKDEP5', 'ALTSUNEKDEP6', 'ALTSUNEKDEP7', 'ALTSUNEKDEP8', 'ALTSUNEKDEP9', 'ALTSUNEKDEP10', 'ALTSUNEKDEP11', 'ALTSUNEKDEP12', 'ALTSUNEKDEP13', 'ALTSUNEKDEP14', 'ALTSUNEKDEP15', 'ALTSUNEKDEP16', 'ALTGEVREKDEP1', 'ALTGEVREKDEP2', 'ALTGEVREKDEP3', 'ALTGEVREKDEP4', 'ALTGEVREKDEP5', 'ALTGEVREKDEP6', 'ALTGEVREKDEP7', 'ALTGEVREKDEP8', 'ALTGEVREKDEP9', 'ALTGEVREKDEP10', 'ALTGEVREKDEP11', 'ALTGEVREKDEP12', 'ALTGEVREKDEP13', 'ALTGEVREKDEP14', 'ALTGEVREKDEP15', 'ALTGEVREKDEP16', 'USTENVEGEVREK', 'USTENVESUNEK', 'ALTENVEGEVREK', 'ALTENVESUNEK']
Combination Name: 14g16q
Selected Combination: 14g16q
Combination successfully selected
FrameForce data successfully retrieved
Retrieved Data:

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members! Already a Member? Login



News


Close Box

Join Eng-Tips® Today!

Join your peers on the Internet's largest technical engineering professional community.
It's easy to join and it's free.

Here's Why Members Love Eng-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close