Add Area by Coord Method - ETABS API
Add Area by Coord Method - ETABS API
(OP)
I'm trying to write some code in Python that draws a slab in ETABS. However, API documentation is scarce for Python for this method. An example is given for VB:
I don't quite know how to manipulate this for Python. The C# documentation shows:
Should I be passing arrays of x,y,z coordinates? Does anyone know how to create the equivalent code in Python?
Thanks!
CODE
'add area object by coordinates ReDim x(5) ReDim y(5) ReDim z(5) x(0) = 50: y(0) = 0 x(1) = 100: y(1) = 0 x(2) = 150: y(2) = 40 x(3) = 100: y(3) = 80 x(4) = 50: y(4) = 80 x(5) = 0: y(5) = 40 ret = SapModel.AreaObj.AddByCoord(6, x, y, z, Name)
I don't quite know how to manipulate this for Python. The C# documentation shows:
CODE
int AddByCoord( int NumberPoints, ref double[] X, ref double[] Y, ref double[] Z, ref string Name, string PropName = "Default", string UserName = "", string CSys = "Global" )
Should I be passing arrays of x,y,z coordinates? Does anyone know how to create the equivalent code in Python?
Thanks!
RE: Add Area by Coord Method - ETABS API
CODE --> python
Your require four input needs to be:
NumberPoints: int
X: list (of float type)
Y: list (of float type)
Z: list (of float type)
For a 4-noded shell elements, the X, Y & Z lists must have five elements, the values need to go [node1,node2,node3,node4,node1].
General finite elements rules apply, element won't be added if nodes aren't collinear and I think you might get into trouble if adding a 4-node element with a reflexive internal angle.
My preference is to add an area element by add by point method.
CODE --> python
RE: Add Area by Coord Method - ETABS API
CODE --> Python
S&T
RE: Add Area by Coord Method - ETABS API
Seems like there is a lot of good stuff in there as compared to just the .chm file that has been my only reference.
S&T
RE: Add Area by Coord Method - ETABS API
RE: Add Area by Coord Method - ETABS API
>> help(comtypes)
At the bottom, it will give file locations "c:\users\XXXXXX\anaconda3\lib\site-packages\comtypes\__init__.py"
In that comtypes folder, there will be a gen folder. In the gen folder there will be few files depending on how my programs u access through comtypes. Open the one that says ETAB2018.py, in that it will reference the file it uses will be an obscure filename "from comtypes.gen import _769D0CFD_A487_4251_A5D4_29A737893481_0_54_0".
This file will have all the classes and methods that you can use.
RE: Add Area by Coord Method - ETABS API
I am trying to get ETABS to draw slab area elements on each floor using Python. I have a list containing point data for each node's XYZ coords on a given story:
CODE
I have the following code which loops through to create a floor on the first floor (3m):
CODE
This creates the x,y,z array for the first story set of nodes, but I'm not sure how to nest another for loop to do this for each story.
Do you have any advice?
RE: Add Area by Coord Method - ETABS API
If they are you can add an extra step to the loop:
CODE