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!

CSI API- Python 3- need some explanation on how to interpret the below part of the code

Status
Not open for further replies.

Raqueeb

Structural
Joined
Jun 25, 2013
Messages
10
Location
AE
I am trying to learn to write API for CSI Etabs in Python. From the .py file created in the comtypes generated modules, below is an example of a function. In this can some one please explain what does ['in', 'out'] mean, and how to make use of this function.

COMMETHOD([dispid(17)], HRESULT, 'GetElm',
( ['in'], BSTR, 'Name' ),
( ['in', 'out'], POINTER(c_int), 'NElm' ),
( ['in', 'out'], POINTER(_midlSAFEARRAY(BSTR)), 'Elm' ),
( ['in', 'out'], POINTER(_midlSAFEARRAY(c_double)), 'RDI' ),
( ['in', 'out'], POINTER(_midlSAFEARRAY(c_double)), 'RDJ' ),
( ['out', 'retval'], POINTER(c_int), 'pRetVal' )),
 
Raqueeb

Thanks for posting. Looks like you are trying to use the function "FrameObj.GetElm". For reference to using the function, it is probably easier to refer to the .chm file located in the etabs install directory. Should be located in "Program Files\Computers and Structures\ETABS 18\CSi API ETABS v1.chm". Best to look at the VB reference, very similar to python.

The part of the code you have referred to in your question.

> 'GetElm' = Frame Object method i.e. FrameObj.GetElm()
> ['in'], BSTR, 'Name' = 'in' means user input, BSTR is COM type data type, this is string data-type in python (str) where the string is the unique frame name.
> ['in', 'out'] = 'out' means that it is an output.

To use the function try, for element with the frame name '1'.
Python:
SapModel.FrameObj.GetElm('1')

Should return:
[1, ('1',), (0.0,), (1.0,), 0]

Try some other of the FrameObj methods
Python:
SapModel.FrameObj.GetSection('1')
 
Thanks Daniel. Really appreciate your help..👍
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top