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 JAE on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

ETABS - EXCEL API

Status
Not open for further replies.

Pezhmankhan

Structural
Joined
Dec 28, 2019
Messages
4
Location
IR
Hi All,

I am starting using ETABS 2016 API in Excel.

One of my problem is setting the current unit of ETABS 2016 unit to my desire unit which is kN.mm.C.

I had tried the following codes, but none of them change the ETABS unit:

ret = mySapModel.SetPresentUnits_2(ETABS2016.eForce_kN, ETABS2016.eLength_mm, ETABS2016.eTemperature_C)
ret = mySapModel.SetPresentUnits(kN_mm_C)
ret = mySapModel.SetPresentUnits(eUnits_kN_mm_C)
ret = mySapModel.SetPresentUnits(ETABS2016.eUnits_kN_mm_C)

I hope someone can help me.
 
Good to see you are using the etabs api. I spent about a year using it with VBA before converting over to Python.

Try using the interger value given in the eUnits Enumeration:

ret=mySapModel.SetPresentUnits(5)
 
Dear rscassar,

I checked it, but it didn't work.
 
Try using the GetPresentUnits() method and see what data type is returned
 
I looked over some of my old VBA scripts, have a look at this one here

VBA_set_present_units_okcyrh.png
 
Dear rscassar,

I check it, the return values are OK, and it seems that the function work, but the displayed unit in ETABS do not changes and when I apply some editing, it is done based on ETABS unit and not the set unit.
 
When exporting from ETABS to excel what is exported is the Database units, not the present units. If you use the GetDatabaseUnits function you will see they are different than the present units.
I believe there is a SetDatabaseUnits which you can use in lieu of your SetPresentUnits function.
If there is no GetDatabaseUnits function, you’ll have to set up functions that scale the result to the desired units based on what GetPresentUnits outputs.
 
Hi,

Thanks a lot. yes, the displayed unit is not used for database.

I have another question:

Is there any command that we can define a time history function automatically in ETABS?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top