sticksandtriangles
Structural
- Apr 7, 2015
- 494
I am diving in to try to understand how to leverage the ETABs API to retrieve analysis results (rather than outputting excel type files and importing that data into python).
I am struggling to understand how to retrieve spandrel results from the model.
My current code:
This code opens the ETABs model I path to and the analysis is run, but I have played around with the bolded and underlined line part of code and have yet to get any results from the model. Documentation for this in python seems to be a little lacking. I am not sure what inputs to the spandrelforce function are required to achieve output. Ideally I would like to pull results (V2,M3) for all load cases (dead, live, etc.) for all spandrels in my model.
Thanks for your thoughts
S&T
I am struggling to understand how to retrieve spandrel results from the model.
My current code:
Python:
import os
import sys
import comtypes.client
ProgramPath = r"C:\Program Files\Computers and Structures\ETABS 18\ETABS.exe"
ModelPath = r"C:\Users\me\Desktop\ETABs Models\my_model.EDB"
helper = comtypes.client.CreateObject('ETABSv1.Helper')
helper = helper.QueryInterface(comtypes.gen.ETABSv1.cHelper)
#create API helper object
myETABSObject = helper.CreateObject(ProgramPath)
#start ETABS application
myETABSObject.ApplicationStart()
#create SapModel object
SapModel = myETABSObject.SapModel
#initialize model
ret = SapModel.InitializeNewModel()
#open an existing file
ret = SapModel.File.OpenFile(ModelPath)
#run model (this will create the analysis model)
ret = SapModel.Analyze.RunAnalysis()
[u][b]#spandrelresults=SapModel.AnalysisResults.SpandrelForce()[/b][/u]
[u][b]spandrelresults=SapModel.AnalysisResults.SpandrelForce(1,"Level 1","S1", "Dead","Left")[/b][/u]
#values = SapModel.DatabaseTables.GetAllTables
This code opens the ETABs model I path to and the analysis is run, but I have played around with the bolded and underlined line part of code and have yet to get any results from the model. Documentation for this in python seems to be a little lacking. I am not sure what inputs to the spandrelforce function are required to achieve output. Ideally I would like to pull results (V2,M3) for all load cases (dead, live, etc.) for all spandrels in my model.
Thanks for your thoughts
S&T