Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

Etabs Oapi

Status
Not open for further replies.

Sahil_Goyal

Civil/Environmental
Oct 12, 2018
2
Hi,

I want to extract the unique names of selected point objects to an excel sheet using Etabs API.
I am using the get selected method to achieve this but it is not working for me.
Does anyone has any idea about how this can be done.


Thanks
Sahil
 
Replies continue below

Recommended for you

I use python when using the Etabs OAPI and my code for getting all the points is:

def getAllPoints(incRestraint=False,units="mm"):
"""
This will return all the points of the model.
"""
[numberPts,ptNames,ptX,ptY,ptZ,ptCsys]=SapModel.PointObj.GetAllPoints()
#ptsConnectivityBinder=[]
#for i in range(numberPts):
# ptConnectivityBinder=SapModel.PointObj.GetConnectivity(ptNames)
# ptsConnectivityBinder.append(ptConnectivityBinder)
ptsRestraint=[]
if(incRestraint):
for i in range(numberPts):
ptRestraintSA=SapModel.PointObj.GetRestraint(ptNames)
ptRestraint=ptRestraintSA[0][0]
ptsRestraint.append(ptRestraint)
ptList=[]
for i in range(numberPts):
if(incRestraint):
if(units=="mm"):
ptList.append([ptNames,ptX,ptY,ptZ,ptsRestraint])
else:
ptList.append([ptNames,ptX*10**3,ptY*10**3,ptZ*10**3,ptsRestraint])
else:
if(units=="mm"):
ptList.append([ptNames,ptX,ptY,ptZ])
else:
ptList.append([ptNames,ptX*10**3,ptY*10**3,ptZ*10**3])
return ptList
 
Thanks for your response.
But this will give me all the points in the model. I want data only for the selected points(the points which user selects in the model).
 
Yup, I get all the points in a list like in the code above, then the code would be something like:

selectedPts=[]
for i in ptLst:
if SapModel.PointObj.GetSelected(i)==True:
selectedPts+=
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor