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"

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):
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


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

def get_etabs_combinations(self):
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")
print("Connection Status: Not Connected")

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

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):
combination = input("Combination Name: ")

if __name__ == "__main__":
app = EtabsColumnForcesConsole()
Connection Status: Connected
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


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