midas-civil 1.0.8__tar.gz → 1.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of midas-civil might be problematic. Click here for more details.
- {midas_civil-1.0.8 → midas_civil-1.1.0}/PKG-INFO +2 -1
- midas_civil-1.1.0/midas_civil/__init__.py +48 -0
- {midas_civil-1.0.8 → midas_civil-1.1.0}/midas_civil/_element.py +53 -13
- {midas_civil-1.0.8 → midas_civil-1.1.0}/midas_civil/_mapi.py +42 -14
- {midas_civil-1.0.8 → midas_civil-1.1.0}/midas_civil/_material.py +4 -0
- {midas_civil-1.0.8 → midas_civil-1.1.0}/midas_civil/_node.py +7 -0
- {midas_civil-1.0.8 → midas_civil-1.1.0}/midas_civil/_result_extract.py +57 -3
- midas_civil-1.1.0/midas_civil/_section/_TapdbSecSS.py +175 -0
- midas_civil-1.1.0/midas_civil/_section/_dbSecSS.py +164 -0
- {midas_civil-1.0.8 → midas_civil-1.1.0}/midas_civil/_section/_pscSS.py +30 -0
- {midas_civil-1.0.8 → midas_civil-1.1.0}/midas_civil/_tendon.py +3 -1
- {midas_civil-1.0.8 → midas_civil-1.1.0}/midas_civil/_thickness.py +5 -0
- {midas_civil-1.0.8 → midas_civil-1.1.0}/midas_civil/_utils.py +9 -1
- {midas_civil-1.0.8 → midas_civil-1.1.0}/midas_civil.egg-info/PKG-INFO +2 -1
- {midas_civil-1.0.8 → midas_civil-1.1.0}/midas_civil.egg-info/requires.txt +1 -0
- {midas_civil-1.0.8 → midas_civil-1.1.0}/setup.py +3 -2
- midas_civil-1.0.8/midas_civil/__init__.py +0 -49
- midas_civil-1.0.8/midas_civil/_section/_TapdbSecSS.py +0 -47
- midas_civil-1.0.8/midas_civil/_section/_dbSecSS.py +0 -57
- {midas_civil-1.0.8 → midas_civil-1.1.0}/LICENSE +0 -0
- {midas_civil-1.0.8 → midas_civil-1.1.0}/README.md +0 -0
- {midas_civil-1.0.8 → midas_civil-1.1.0}/midas_civil/_BoundaryChangeAssignment.py +0 -0
- {midas_civil-1.0.8 → midas_civil-1.1.0}/midas_civil/_analysiscontrol.py +0 -0
- {midas_civil-1.0.8 → midas_civil-1.1.0}/midas_civil/_boundary.py +0 -0
- {midas_civil-1.0.8 → midas_civil-1.1.0}/midas_civil/_construction.py +0 -0
- {midas_civil-1.0.8 → midas_civil-1.1.0}/midas_civil/_construction_backup.py +0 -0
- {midas_civil-1.0.8 → midas_civil-1.1.0}/midas_civil/_group.py +0 -0
- {midas_civil-1.0.8 → midas_civil-1.1.0}/midas_civil/_load.py +0 -0
- {midas_civil-1.0.8 → midas_civil-1.1.0}/midas_civil/_model.py +0 -0
- {midas_civil-1.0.8 → midas_civil-1.1.0}/midas_civil/_movingload.py +0 -0
- {midas_civil-1.0.8 → midas_civil-1.1.0}/midas_civil/_result copy.py +0 -0
- {midas_civil-1.0.8 → midas_civil-1.1.0}/midas_civil/_result.py +0 -0
- {midas_civil-1.0.8 → midas_civil-1.1.0}/midas_civil/_section/__init__.py +0 -0
- {midas_civil-1.0.8 → midas_civil-1.1.0}/midas_civil/_section/_compositeSS.py +0 -0
- {midas_civil-1.0.8 → midas_civil-1.1.0}/midas_civil/_section/_offsetSS.py +0 -0
- {midas_civil-1.0.8 → midas_civil-1.1.0}/midas_civil/_section/_tapPSC1CellSS.py +0 -0
- {midas_civil-1.0.8 → midas_civil-1.1.0}/midas_civil/_section/_unSupp.py +0 -0
- {midas_civil-1.0.8 → midas_civil-1.1.0}/midas_civil/_settlement.py +0 -0
- {midas_civil-1.0.8 → midas_civil-1.1.0}/midas_civil/_temperature.py +0 -0
- {midas_civil-1.0.8 → midas_civil-1.1.0}/midas_civil/_view.py +0 -0
- {midas_civil-1.0.8 → midas_civil-1.1.0}/midas_civil.egg-info/SOURCES.txt +0 -0
- {midas_civil-1.0.8 → midas_civil-1.1.0}/midas_civil.egg-info/dependency_links.txt +0 -0
- {midas_civil-1.0.8 → midas_civil-1.1.0}/midas_civil.egg-info/top_level.txt +0 -0
- {midas_civil-1.0.8 → midas_civil-1.1.0}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: midas_civil
|
|
3
|
-
Version: 1.0
|
|
3
|
+
Version: 1.1.0
|
|
4
4
|
Summary: Python library for MIDAS Civil NX
|
|
5
5
|
Home-page: https://github.com/MIDASIT-Co-Ltd/midas-civil-python
|
|
6
6
|
Author: Sumit Shekhar
|
|
@@ -14,6 +14,7 @@ Requires-Dist: polars
|
|
|
14
14
|
Requires-Dist: xlsxwriter
|
|
15
15
|
Requires-Dist: requests
|
|
16
16
|
Requires-Dist: scipy
|
|
17
|
+
Requires-Dist: colorama
|
|
17
18
|
Dynamic: author
|
|
18
19
|
Dynamic: author-email
|
|
19
20
|
Dynamic: description
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import requests
|
|
2
|
+
from colorama import Fore,Style
|
|
3
|
+
from ._mapi import *
|
|
4
|
+
_version_ = "1.1.0"
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
print('\n╭────────────────────────────────────────────────────────────────────────────────────╮')
|
|
8
|
+
print(Style.BRIGHT+f'│ MIDAS CIVIL-NX PYTHON LIBRARY v{_version_} 🐍 │')
|
|
9
|
+
print('╰────────────────────────────────────────────────────────────────────────────────────╯\n'+Style.RESET_ALL)
|
|
10
|
+
|
|
11
|
+
if NX.version_check:
|
|
12
|
+
resp = requests.get("https://pypi.org/pypi/midas_civil/json").json()
|
|
13
|
+
latest_ver = resp["info"]["version"]
|
|
14
|
+
if _version_ != latest_ver:
|
|
15
|
+
print(Fore.YELLOW +'╭─ ⚠️ ──────────────────────────────────────────────────────────────────────────────╮')
|
|
16
|
+
print(f"│ Warning: You are using v{_version_}, but the latest available version is v{latest_ver}. │")
|
|
17
|
+
print(f"│ Run 'pip install midas_civil --upgrade' to update. │")
|
|
18
|
+
print('╰────────────────────────────────────────────────────────────────────────────────────╯\n'+Style.RESET_ALL)
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
from ._model import *
|
|
22
|
+
from ._boundary import *
|
|
23
|
+
from ._utils import *
|
|
24
|
+
from ._node import *
|
|
25
|
+
from ._element import *
|
|
26
|
+
from ._load import *
|
|
27
|
+
from ._group import *
|
|
28
|
+
from ._result import *
|
|
29
|
+
|
|
30
|
+
#--- TESTING IMPORTS ---
|
|
31
|
+
from ._material import *
|
|
32
|
+
|
|
33
|
+
# from ._section import *
|
|
34
|
+
from ._section import *
|
|
35
|
+
|
|
36
|
+
from ._result_extract import *
|
|
37
|
+
from ._construction import *
|
|
38
|
+
from ._thickness import *
|
|
39
|
+
from ._temperature import *
|
|
40
|
+
|
|
41
|
+
from ._tendon import *
|
|
42
|
+
from ._view import *
|
|
43
|
+
|
|
44
|
+
from ._movingload import *
|
|
45
|
+
from ._settlement import *
|
|
46
|
+
from ._analysiscontrol import *
|
|
47
|
+
from ._BoundaryChangeAssignment import*
|
|
48
|
+
|
|
@@ -8,7 +8,7 @@ from math import hypot
|
|
|
8
8
|
import math
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
def _interpolateAlignment(pointsArray,n_seg=10,deg=1,mSize=0,includePoint:bool=True
|
|
11
|
+
def _interpolateAlignment(pointsArray,n_seg=10,deg=1,mSize=0,includePoint:bool=True) -> list:
|
|
12
12
|
''' Returns point list and beta angle list'''
|
|
13
13
|
pointsArray = np.array(pointsArray)
|
|
14
14
|
x_p, y_p , z_p = pointsArray[:,0] , pointsArray[:,1] , pointsArray[:,2]
|
|
@@ -110,7 +110,7 @@ def _triangleAREA(a:Node,b:Node,c:Node):
|
|
|
110
110
|
mag = np.linalg.norm(np.cross(v1, v2))
|
|
111
111
|
return float(0.5 * mag) , np.cross(v1, v2)/mag
|
|
112
112
|
|
|
113
|
-
def _calcVector(deltaLocation):
|
|
113
|
+
def _calcVector(deltaLocation,angle=0): # Returns normalised local X,Y,Z for line
|
|
114
114
|
Z_new = np.array([0.000001,0,1])
|
|
115
115
|
X_new = np.array(deltaLocation)
|
|
116
116
|
Y_new = np.cross(Z_new, X_new)
|
|
@@ -121,22 +121,45 @@ def _calcVector(deltaLocation):
|
|
|
121
121
|
Y_new = Y_new / (np.linalg.norm(Y_new)+0.000001)
|
|
122
122
|
Z_new = Z_new / (np.linalg.norm(Z_new)+0.000001)
|
|
123
123
|
|
|
124
|
-
|
|
124
|
+
from scipy.spatial.transform import Rotation as R
|
|
125
|
+
p_y = np.array(Y_new)
|
|
126
|
+
p_z = np.array(Z_new)
|
|
127
|
+
|
|
128
|
+
axis = np.array(X_new)
|
|
129
|
+
theta = np.deg2rad(angle) # or radians directly
|
|
130
|
+
rot = R.from_rotvec(axis * theta) # axis-angle as rotation vector
|
|
131
|
+
|
|
132
|
+
rt_y = rot.apply(p_y) # rotated point around axis through origin
|
|
133
|
+
rt_z = rot.apply(p_z)
|
|
134
|
+
|
|
135
|
+
return [X_new,rt_y,rt_z]
|
|
136
|
+
|
|
137
|
+
def _rotatePT(pt,axis,deg):
|
|
138
|
+
from scipy.spatial.transform import Rotation as R
|
|
139
|
+
p = np.array(pt)
|
|
140
|
+
axis = np.array(axis)
|
|
141
|
+
theta = np.deg2rad(deg) # or radians directly
|
|
142
|
+
rot = R.from_rotvec(axis * theta) # axis-angle as rotation vector
|
|
143
|
+
return rot.apply(p) # rotated point around axis through origin
|
|
144
|
+
|
|
145
|
+
def _pointOffset(pts,yEcc=0,zEcc=0,angle=0):
|
|
146
|
+
from ._utils import _matchArray
|
|
147
|
+
|
|
148
|
+
angle2 = _matchArray(pts,angle)
|
|
125
149
|
|
|
126
|
-
def _pointOffset(pts,yEcc,zEcc):
|
|
127
150
|
norm = []
|
|
128
|
-
norm.append(_calcVector(np.subtract(pts[1],pts[0])))
|
|
151
|
+
norm.append(_calcVector(np.subtract(pts[1],pts[0]),angle2[0])) # first X- along vector
|
|
129
152
|
|
|
130
|
-
for i in range(len(pts)-2):
|
|
153
|
+
for i in range(len(pts)-2): # Averaged X- along vector for middle points
|
|
131
154
|
X_new1 = np.array(np.subtract(pts[i+1],pts[i]))
|
|
132
155
|
X_new2 = np.array(np.subtract(pts[i+2],pts[i+1]))
|
|
133
156
|
|
|
134
157
|
X_new1 = X_new1 / (np.linalg.norm(X_new1)+0.000001)
|
|
135
158
|
X_new2 = X_new2 / (np.linalg.norm(X_new2)+0.000001)
|
|
136
159
|
|
|
137
|
-
norm.append(_calcVector(np.add(X_new1,X_new2)))
|
|
160
|
+
norm.append(_calcVector(np.add(X_new1,X_new2),angle2[i+1]))
|
|
138
161
|
|
|
139
|
-
norm.append(_calcVector(np.subtract(pts[-1],pts[-2])))
|
|
162
|
+
norm.append(_calcVector(np.subtract(pts[-1],pts[-2]),angle2[-1])) # last X- along vector
|
|
140
163
|
|
|
141
164
|
# print(norm)
|
|
142
165
|
|
|
@@ -329,6 +352,12 @@ class Element:
|
|
|
329
352
|
Element.elements = []
|
|
330
353
|
Element.ids = []
|
|
331
354
|
Element.__elemDIC__={}
|
|
355
|
+
|
|
356
|
+
@staticmethod
|
|
357
|
+
def clear():
|
|
358
|
+
Element.elements = []
|
|
359
|
+
Element.ids = []
|
|
360
|
+
Element.__elemDIC__={}
|
|
332
361
|
|
|
333
362
|
# --- Element Type Subclasses ---
|
|
334
363
|
|
|
@@ -440,6 +469,10 @@ class Element:
|
|
|
440
469
|
i_loc = points_loc
|
|
441
470
|
else:
|
|
442
471
|
i_loc = _interpolateAlignment(points_loc,n_div,deg,0,includePoint)
|
|
472
|
+
|
|
473
|
+
from ._utils import _matchArray
|
|
474
|
+
angle = _matchArray(i_loc,angle)
|
|
475
|
+
|
|
443
476
|
for i in i_loc:
|
|
444
477
|
Enode=Node(i[0],i[1],i[2])
|
|
445
478
|
beam_nodes.append(Enode.ID)
|
|
@@ -447,29 +480,36 @@ class Element:
|
|
|
447
480
|
for i in range(len(i_loc)-1):
|
|
448
481
|
if id == 0 : id_new = 0
|
|
449
482
|
else: id_new = id+i
|
|
450
|
-
beam_obj.append(Element.Beam(beam_nodes[i],beam_nodes[i+1],mat,sect,angle,group,id_new,bLocalAxis))
|
|
483
|
+
beam_obj.append(Element.Beam(beam_nodes[i],beam_nodes[i+1],mat,sect,angle[i],group,id_new,bLocalAxis))
|
|
451
484
|
|
|
452
485
|
return beam_obj
|
|
453
486
|
|
|
454
487
|
@staticmethod
|
|
455
488
|
def PLine2(points_loc:list,n_div:int=0,deg:int=1,includePoint:bool=True,mat:int=1,sect:int=1,angle:float=0, group = "" , id: int = 0,bLocalAxis=False,yEcc=0,zEcc=0):
|
|
456
|
-
|
|
489
|
+
|
|
490
|
+
|
|
457
491
|
beam_nodes =[]
|
|
458
492
|
beam_obj = []
|
|
459
493
|
if n_div == 0 :
|
|
460
494
|
i_loc = points_loc
|
|
461
495
|
else:
|
|
462
|
-
i_loc = _interpolateAlignment(points_loc,n_div,deg,0,includePoint
|
|
496
|
+
i_loc = _interpolateAlignment(points_loc,n_div,deg,0,includePoint)
|
|
497
|
+
|
|
498
|
+
from ._utils import _matchArray
|
|
499
|
+
angle = _matchArray(i_loc,angle)
|
|
463
500
|
|
|
464
|
-
i_loc2 = _pointOffset(i_loc,yEcc,zEcc)
|
|
501
|
+
i_loc2 = _pointOffset(i_loc,yEcc,zEcc,angle)
|
|
465
502
|
for i in i_loc2:
|
|
466
503
|
Enode=Node(i[0],i[1],i[2])
|
|
467
504
|
beam_nodes.append(Enode.ID)
|
|
505
|
+
|
|
468
506
|
|
|
507
|
+
|
|
508
|
+
|
|
469
509
|
for i in range(len(i_loc2)-1):
|
|
470
510
|
if id == 0 : id_new = 0
|
|
471
511
|
else: id_new = id+i
|
|
472
|
-
beam_obj.append(Element.Beam(beam_nodes[i],beam_nodes[i+1],mat,sect,angle,group,id_new,bLocalAxis))
|
|
512
|
+
beam_obj.append(Element.Beam(beam_nodes[i],beam_nodes[i+1],mat,sect,angle[i],group,id_new,bLocalAxis))
|
|
473
513
|
|
|
474
514
|
return beam_obj
|
|
475
515
|
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import requests
|
|
2
2
|
import sys
|
|
3
|
+
from colorama import Fore, Style
|
|
3
4
|
try:import winreg
|
|
4
5
|
except: pass
|
|
6
|
+
import time
|
|
5
7
|
|
|
6
8
|
|
|
7
9
|
|
|
8
10
|
|
|
9
11
|
def Midas_help():
|
|
10
12
|
"""MIDAS Documnetation : https://midas-rnd.github.io/midasapi-python """
|
|
11
|
-
print(
|
|
12
|
-
print("
|
|
13
|
-
print(
|
|
14
|
-
|
|
13
|
+
print('\n╭────────────────────────────────────────────────────────────────────────────────────╮')
|
|
14
|
+
print("│ HELP MANUAL : https://midas-rnd.github.io/midasapi-python/ │")
|
|
15
|
+
print('╰────────────────────────────────────────────────────────────────────────────────────╯\n')
|
|
15
16
|
|
|
16
17
|
|
|
17
18
|
|
|
@@ -94,7 +95,6 @@ class MAPI_KEY:
|
|
|
94
95
|
my_key = value[0]
|
|
95
96
|
MAPI_KEY(my_key)
|
|
96
97
|
print(f' 🔑 MAPI-KEY is taken from Registry entry. >> {my_key[:35]}...')
|
|
97
|
-
print("-"*85)
|
|
98
98
|
except:
|
|
99
99
|
print(f"🔑 MAPI KEY is not defined. Click on Apps > API Settings to copy the MAPI Key.\n Define it using MAPI_KEY('xxxx')")
|
|
100
100
|
sys.exit(0)
|
|
@@ -125,6 +125,9 @@ def MidasAPI(method:str, command:str, body:dict={})->dict:
|
|
|
125
125
|
"MAPI-Key": mapi_key
|
|
126
126
|
}
|
|
127
127
|
|
|
128
|
+
start_time = time.perf_counter()
|
|
129
|
+
|
|
130
|
+
|
|
128
131
|
if method == "POST":
|
|
129
132
|
response = requests.post(url=url, headers=headers, json=body)
|
|
130
133
|
elif method == "PUT":
|
|
@@ -134,16 +137,24 @@ def MidasAPI(method:str, command:str, body:dict={})->dict:
|
|
|
134
137
|
elif method == "DELETE":
|
|
135
138
|
response = requests.delete(url=url, headers=headers)
|
|
136
139
|
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
sys.exit(0)
|
|
140
|
+
end_time = time.perf_counter()
|
|
141
|
+
elapsed_time = end_time - start_time
|
|
140
142
|
|
|
141
143
|
if NX.debug_print:
|
|
142
|
-
print(method
|
|
144
|
+
print(f"{method} | URL : {command} | STATUS : {response.status_code} | TIME : {elapsed_time:.4f} sec")
|
|
145
|
+
|
|
146
|
+
|
|
143
147
|
|
|
144
148
|
if MAPI_KEY.count == 1:
|
|
149
|
+
MAPI_KEY.count = 0
|
|
150
|
+
if response.status_code == 404:
|
|
151
|
+
print(Fore.RED +'\n╭─ 💀 ─────────────────────────────────────────────────────────────────────────────╮')
|
|
152
|
+
print(f"│ Civil NX model is not connected. Click on 'Apps > Connect' in Civil NX. │")
|
|
153
|
+
print(f"│ Make sure the MAPI Key in python code is matching with the MAPI key in Civil NX. │")
|
|
154
|
+
print('╰────────────────────────────────────────────────────────────────────────────────────╯\n'+Style.RESET_ALL)
|
|
155
|
+
sys.exit(0)
|
|
156
|
+
|
|
145
157
|
if NX.user_print:
|
|
146
|
-
MAPI_KEY.count = 0
|
|
147
158
|
_checkUSER()
|
|
148
159
|
|
|
149
160
|
|
|
@@ -168,8 +179,25 @@ def _setUNIT(unitJS):
|
|
|
168
179
|
def _checkUSER():
|
|
169
180
|
try:
|
|
170
181
|
resp = MidasAPI('GET','/config/ver',{})['VER']
|
|
171
|
-
|
|
172
|
-
print(f"
|
|
173
|
-
print("
|
|
182
|
+
|
|
183
|
+
# print(f"{' '*15}Connected to {resp['NAME']}")
|
|
184
|
+
# print(f"{' '*15}USER : {resp['USER']} COMPANY : {resp['COMPANY']}")
|
|
185
|
+
|
|
186
|
+
ln1 = f"Connected to {resp['NAME']}"
|
|
187
|
+
ln2 = f"USER : {resp['USER']} COMPANY : {resp['COMPANY']}"
|
|
188
|
+
|
|
189
|
+
lg_ln1 = 63-len(ln1)
|
|
190
|
+
lg_ln2 = 67-len(ln2)
|
|
191
|
+
|
|
192
|
+
line1 = f"│{' '*15} {ln1} {' '*lg_ln1} 🟢 │"
|
|
193
|
+
line2 = f"│{' '*15} {ln2} {' '*lg_ln2}│"
|
|
194
|
+
print(Fore.GREEN+'\n╭─ 🔔 ──────────────────────────────────────────────────────────────────────────────╮')
|
|
195
|
+
print(line1)
|
|
196
|
+
print(line2)
|
|
197
|
+
print('╰────────────────────────────────────────────────────────────────────────────────────╯\n'+Style.RESET_ALL)
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
# print('─'*86)
|
|
201
|
+
|
|
174
202
|
except:
|
|
175
|
-
|
|
203
|
+
pass
|
|
@@ -135,7 +135,7 @@ class Result :
|
|
|
135
135
|
"TABLE_NAME": tableName,
|
|
136
136
|
"STYLES": {
|
|
137
137
|
"FORMAT": "Fixed",
|
|
138
|
-
"PLACE":
|
|
138
|
+
"PLACE": 5
|
|
139
139
|
}
|
|
140
140
|
}
|
|
141
141
|
}
|
|
@@ -162,7 +162,7 @@ class Result :
|
|
|
162
162
|
|
|
163
163
|
|
|
164
164
|
|
|
165
|
-
# ---------- Result TABLE ------------------------------
|
|
165
|
+
# ---------- Result TABLE (For ALL TABLES)------------------------------
|
|
166
166
|
@staticmethod
|
|
167
167
|
def ResultTable(tabletype:str,keys=[],loadcase:list=[],cs_stage=[],force_unit='KN',len_unit='M'):
|
|
168
168
|
'''
|
|
@@ -177,7 +177,7 @@ class Result :
|
|
|
177
177
|
"TABLE_TYPE": tabletype,
|
|
178
178
|
"STYLES": {
|
|
179
179
|
"FORMAT": "Fixed",
|
|
180
|
-
"PLACE":
|
|
180
|
+
"PLACE": 5
|
|
181
181
|
}
|
|
182
182
|
}
|
|
183
183
|
}
|
|
@@ -204,3 +204,57 @@ class Result :
|
|
|
204
204
|
ss_json = MidasAPI("POST","/post/table",js_dat)
|
|
205
205
|
_setUNIT(currUNIT)
|
|
206
206
|
return _JSToDF_ResTable(ss_json)
|
|
207
|
+
|
|
208
|
+
|
|
209
|
+
class TABLE :
|
|
210
|
+
@staticmethod
|
|
211
|
+
def BeamForce_VBM(keys=[],loadcase:list=[],items=['all'],parts=["PartI", "PartJ"],components=['all'],force_unit='KN',len_unit='M'):
|
|
212
|
+
'''
|
|
213
|
+
Keys : List{int} -> Element/ Node IDs | str -> Structure Group Name
|
|
214
|
+
Loadcase : Loadcase name followed by type. eg. DeadLoad(ST)
|
|
215
|
+
Items to display : [ "Axial" , "Shear-y" , "Shear-z" , "Torsion" , "Moment-y" , "Moment-z"]
|
|
216
|
+
Parts : ["PartI", "Part1/4", "Part2/4", "Part3/4", "PartJ"]
|
|
217
|
+
Components (colms of tabulart result): [ "Elem", "Load", "Part", "Component", "Axial", "Shear-y", "Shear-z", "Torsion", "Moment-y", "Moment-z" ]
|
|
218
|
+
|
|
219
|
+
'''
|
|
220
|
+
|
|
221
|
+
js_dat = {
|
|
222
|
+
"Argument": {
|
|
223
|
+
"TABLE_NAME": "SS_Table",
|
|
224
|
+
"TABLE_TYPE": "BEAMFORCEVBM",
|
|
225
|
+
"STYLES": {
|
|
226
|
+
"FORMAT": "Fixed",
|
|
227
|
+
"PLACE": 5
|
|
228
|
+
},
|
|
229
|
+
"PARTS" : parts
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
|
|
234
|
+
if isinstance(keys,list):
|
|
235
|
+
if keys!=[]:
|
|
236
|
+
js_dat["Argument"]['NODE_ELEMS'] = {"KEYS": keys}
|
|
237
|
+
elif isinstance(keys,str):
|
|
238
|
+
js_dat["Argument"]['NODE_ELEMS'] = {"STRUCTURE_GROUP_NAME": keys}
|
|
239
|
+
|
|
240
|
+
|
|
241
|
+
if loadcase!=[]: js_dat["Argument"]['LOAD_CASE_NAMES'] = loadcase
|
|
242
|
+
|
|
243
|
+
if components!=['all']:
|
|
244
|
+
if "Elem" not in components: components.append("Elem")
|
|
245
|
+
if "Load" not in components: components.append("Load")
|
|
246
|
+
if "Part" not in components: components.append("Part")
|
|
247
|
+
if "Component" not in components: components.append("Component")
|
|
248
|
+
js_dat["Argument"]['COMPONENTS'] = components
|
|
249
|
+
|
|
250
|
+
if items!=['all']:
|
|
251
|
+
js_dat["Argument"]['ITEM_TO_DISPLAY'] = items
|
|
252
|
+
|
|
253
|
+
|
|
254
|
+
|
|
255
|
+
currUNIT = _getUNIT()
|
|
256
|
+
Model.units(force=force_unit,length=len_unit)
|
|
257
|
+
ss_json = MidasAPI("POST","/post/table",js_dat)
|
|
258
|
+
_setUNIT(currUNIT)
|
|
259
|
+
return _JSToDF_ResTable(ss_json)
|
|
260
|
+
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
from ._offsetSS import Offset
|
|
2
|
+
from ._offsetSS import _common
|
|
3
|
+
import math
|
|
4
|
+
|
|
5
|
+
class _SS_TAPERED_DBUSER(_common):
|
|
6
|
+
|
|
7
|
+
""" Create Standard USER DEFINED sections"""
|
|
8
|
+
|
|
9
|
+
def __init__(self,Name='',Shape='',params_I:list=[],params_J:list=[],Offset=Offset(),useShear=True,use7Dof=False,id:int=0):
|
|
10
|
+
""" Shape = 'SB' 'SR' for rectangle \n For cylinder"""
|
|
11
|
+
self.ID = id
|
|
12
|
+
self.NAME = Name
|
|
13
|
+
self.TYPE = 'TAPERED'
|
|
14
|
+
self.SHAPE = Shape
|
|
15
|
+
self.PARAMS_I = params_I
|
|
16
|
+
self.PARAMS_J = params_J
|
|
17
|
+
self.OFFSET = Offset
|
|
18
|
+
self.USESHEAR = useShear
|
|
19
|
+
self.USE7DOF = use7Dof
|
|
20
|
+
self.DATATYPE = 2
|
|
21
|
+
|
|
22
|
+
def __str__(self):
|
|
23
|
+
return f' > ID = {self.ID} | USER DEFINED STANDARD SECTION \nJSON = {self.toJSON()}\n'
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
def toJSON(sect):
|
|
27
|
+
js = {
|
|
28
|
+
"SECTTYPE": sect.TYPE,
|
|
29
|
+
"SECT_NAME": sect.NAME,
|
|
30
|
+
"SECT_BEFORE": {
|
|
31
|
+
"SHAPE": sect.SHAPE,
|
|
32
|
+
"TYPE": sect.DATATYPE,
|
|
33
|
+
"SECT_I": {
|
|
34
|
+
"vSIZE": sect.PARAMS_I
|
|
35
|
+
},
|
|
36
|
+
"SECT_J": {
|
|
37
|
+
"vSIZE": sect.PARAMS_J
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
js['SECT_BEFORE'].update(sect.OFFSET.JS)
|
|
42
|
+
js['SECT_BEFORE']['USE_SHEAR_DEFORM'] = sect.USESHEAR
|
|
43
|
+
js['SECT_BEFORE']['USE_WARPING_EFFECT'] = sect.USE7DOF
|
|
44
|
+
return js
|
|
45
|
+
|
|
46
|
+
@staticmethod
|
|
47
|
+
def _objectify(id,name,type,shape,offset,uShear,u7DOF,js):
|
|
48
|
+
return _SS_TAPERED_DBUSER(name,shape,js['SECT_BEFORE']['SECT_I']['vSIZE'],js['SECT_BEFORE']['SECT_J']['vSIZE'],offset,uShear,u7DOF,id)
|
|
49
|
+
|
|
50
|
+
def _centerLine(shape,end):
|
|
51
|
+
if end:
|
|
52
|
+
shape.PARAMS = shape.PARAMS_J
|
|
53
|
+
# print(' J end taken')
|
|
54
|
+
else:
|
|
55
|
+
# print(' I end taken')
|
|
56
|
+
shape.PARAMS = shape.PARAMS_I
|
|
57
|
+
|
|
58
|
+
if shape.SHAPE == 'SB' :
|
|
59
|
+
H,B = shape.PARAMS[:2]
|
|
60
|
+
|
|
61
|
+
sect_lin_con = [[1,2],[3,1]]
|
|
62
|
+
|
|
63
|
+
sect_cg_LT = [-B/2,H/2]
|
|
64
|
+
sect_cg_CC = [0,0]
|
|
65
|
+
sect_cg_RB = [B/2,-H/2]
|
|
66
|
+
|
|
67
|
+
if H > B :
|
|
68
|
+
sect_shape = [[0,0],[0,H/2],[0,-H/2],[0,H/4],[0,-H/4]]
|
|
69
|
+
sect_thk = [B,B,B,B]
|
|
70
|
+
sect_thk_off = [0,0,0,0]
|
|
71
|
+
else :
|
|
72
|
+
sect_shape = [[0,0],[B/2,0],[-B/2,0],[B/4,0],[-B/4,0]]
|
|
73
|
+
sect_thk = [H,H,H,H]
|
|
74
|
+
sect_thk_off = [0,0,0,0]
|
|
75
|
+
|
|
76
|
+
elif shape.SHAPE == 'L' :
|
|
77
|
+
H,B,tw,tf = shape.PARAMS[:4]
|
|
78
|
+
|
|
79
|
+
sect_cg_LT = [0,0]
|
|
80
|
+
sect_cg_CC = [(H*tw*tw+B*B*tf)/(2*(B*tw+H*tf)),-(H*H*tw+B*tf*tf)/(2*(B*tw+H*tf))]
|
|
81
|
+
sect_cg_RB = [B,-H]
|
|
82
|
+
|
|
83
|
+
# sect_shape = [[0.5*tw,-H],[0.5*tw,-0.5*tf],[B,-0.5*tf]]
|
|
84
|
+
sect_shape = [[0,-H],[0,0],[B,0]]
|
|
85
|
+
sect_lin_con = [[3,2],[2,1]]
|
|
86
|
+
sect_thk = [tw,tf]
|
|
87
|
+
# sect_thk_off = [0,0]
|
|
88
|
+
sect_thk_off = [tw/2,tf/2]
|
|
89
|
+
|
|
90
|
+
elif shape.SHAPE == 'C' :
|
|
91
|
+
H,B1,tw,tf1,B2,tf2 = shape.PARAMS[:6]
|
|
92
|
+
if B2 == 0 : B2 = B1
|
|
93
|
+
if tf2 == 0 : tf2 = tf1
|
|
94
|
+
|
|
95
|
+
sect_cg_LT = [0,0]
|
|
96
|
+
sect_cg_CC = [(B1+B2)*0.2,-H*0.5]
|
|
97
|
+
sect_cg_RB = [max(B1,B2),-H]
|
|
98
|
+
|
|
99
|
+
# sect_shape = [[0.5*tw,-0.5*tf1],[B1,-0.5*tf1],[0.5*tw,-H+0.5*tf2],[B2,-H+0.5*tf2]]
|
|
100
|
+
sect_shape = [[0,0],[B1,0],[0,-H],[B2,-H]]
|
|
101
|
+
sect_lin_con = [[2,1],[1,3],[3,4]]
|
|
102
|
+
sect_thk = [tf1,tw,tf2]
|
|
103
|
+
# sect_thk_off = [0,0,0]
|
|
104
|
+
sect_thk_off = [tf1/2,tw/2,tf2/2]
|
|
105
|
+
|
|
106
|
+
elif shape.SHAPE == 'H' :
|
|
107
|
+
H,B1,tw,tf1,B2,tf2,r1,r2 = shape.PARAMS[:8]
|
|
108
|
+
if B2 == 0 : B2 = B1
|
|
109
|
+
if tf2 == 0 : tf2 = tf1
|
|
110
|
+
|
|
111
|
+
sect_cg_LT = [-0.5*max(B1,B2),0.5*H]
|
|
112
|
+
sect_cg_CC = [0,0]
|
|
113
|
+
sect_cg_RB = [0.5*max(B1,B2),-0.5*H]
|
|
114
|
+
|
|
115
|
+
sect_shape = [[-0.5*B1,0.5*(H-tf1)],[0,0.5*(H-tf1)],[0.5*B1,0.5*(H-tf1)],[-0.5*B2,-0.5*(H-tf2)],[0,-0.5*(H-tf2)],[0.5*B2,-0.5*(H-tf2)]]
|
|
116
|
+
sect_lin_con = [[2,1],[3,2],[2,5],[4,5],[5,6]]
|
|
117
|
+
sect_thk = [tf1,tf1,tw,tf2,tf2]
|
|
118
|
+
sect_thk_off = [0,0,0,0,0]
|
|
119
|
+
|
|
120
|
+
elif shape.SHAPE == 'T' :
|
|
121
|
+
H,B,tw,tf = shape.PARAMS[:4]
|
|
122
|
+
|
|
123
|
+
sect_cg_LT = [-B*0.5,0]
|
|
124
|
+
sect_cg_CC = [0,-H*0.3]
|
|
125
|
+
sect_cg_RB = [B*0.5,-H]
|
|
126
|
+
|
|
127
|
+
sect_shape = [[-0.5*B,-0.5*tf],[0,-0.5*tf],[0.5*B,-0.5*tf],[0,-H]]
|
|
128
|
+
sect_lin_con = [[2,1],[3,2],[2,4]]
|
|
129
|
+
sect_thk = [tf,tf,tw]
|
|
130
|
+
sect_thk_off = [0,0,0]
|
|
131
|
+
|
|
132
|
+
elif shape.SHAPE == 'B' :
|
|
133
|
+
H,B,tw,tf1,C,tf2 = shape.PARAMS[:6]
|
|
134
|
+
if tf2 == 0 : tf2 = tf1
|
|
135
|
+
|
|
136
|
+
sect_cg_LT = [-0.5*B,0.5*H]
|
|
137
|
+
sect_cg_CC = [0,0]
|
|
138
|
+
sect_cg_RB = [0.5*B,-0.5*H]
|
|
139
|
+
|
|
140
|
+
# sect_shape = [[0.5*(B-tw),0.5*(H-tf1)],[-0.5*(B-tw),0.5*(H-tf1)],[-0.5*(B-tw),-0.5*(H-tf2)],[0.5*(B-tw),-0.5*(H-tf2)]]
|
|
141
|
+
sect_shape = [[0.5*B,0.5*H],[-0.5*B,0.5*H],[-0.5*B,-0.5*H],[0.5*B,-0.5*H]]
|
|
142
|
+
|
|
143
|
+
sect_lin_con = [[1,2],[2,3],[3,4],[4,1]]
|
|
144
|
+
sect_thk = [tf1,tw,tf2,tw]
|
|
145
|
+
# sect_thk_off = [0,0,0,0]
|
|
146
|
+
sect_thk_off = [0.5*tf1,0.5*tw,0.5*tf2,0.5*tw]
|
|
147
|
+
|
|
148
|
+
elif shape.SHAPE == 'P' :
|
|
149
|
+
D,tw = shape.PARAMS[:2]
|
|
150
|
+
|
|
151
|
+
# R = 0.5*(D-tw)
|
|
152
|
+
R = 0.5*D
|
|
153
|
+
|
|
154
|
+
sect_cg_LT = [-R,R]
|
|
155
|
+
sect_cg_CC = [0,0]
|
|
156
|
+
sect_cg_RB = [R,-R]
|
|
157
|
+
|
|
158
|
+
sect_shape = []
|
|
159
|
+
sect_lin_con = []
|
|
160
|
+
sect_thk = []
|
|
161
|
+
sect_thk_off = []
|
|
162
|
+
|
|
163
|
+
n = 16
|
|
164
|
+
for i in range(n):
|
|
165
|
+
sect_shape.append([R*math.sin(i*2*math.pi/n),R*math.cos(i*2*math.pi/n)])
|
|
166
|
+
sect_lin_con.append([i+1,i+2])
|
|
167
|
+
sect_thk.append(tw)
|
|
168
|
+
sect_thk_off.append(-0.5*tw)
|
|
169
|
+
sect_lin_con[-1] = [i+1,1]
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
sect_cg = (sect_cg_LT,sect_cg_CC,sect_cg_RB)
|
|
174
|
+
|
|
175
|
+
return sect_shape, sect_thk ,sect_thk_off, sect_cg , sect_lin_con
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
from ._offsetSS import Offset
|
|
2
|
+
from ._offsetSS import _common
|
|
3
|
+
import math
|
|
4
|
+
|
|
5
|
+
class _SS_DBUSER(_common):
|
|
6
|
+
|
|
7
|
+
""" Create Standard USER DEFINED sections"""
|
|
8
|
+
|
|
9
|
+
def __init__(self,Name='',Shape='',parameters:list=[],Offset=Offset(),useShear=True,use7Dof=False,id:int=0):
|
|
10
|
+
""" Shape = 'SB' 'SR' for rectangle \n For cylinder"""
|
|
11
|
+
self.ID = id
|
|
12
|
+
self.NAME = Name
|
|
13
|
+
self.TYPE = 'DBUSER'
|
|
14
|
+
self.SHAPE = Shape
|
|
15
|
+
self.PARAMS = parameters
|
|
16
|
+
self.OFFSET = Offset
|
|
17
|
+
self.USESHEAR = useShear
|
|
18
|
+
self.USE7DOF = use7Dof
|
|
19
|
+
self.DATATYPE = 2
|
|
20
|
+
|
|
21
|
+
def __str__(self):
|
|
22
|
+
return f' > ID = {self.ID} | USER DEFINED STANDARD SECTION \nJSON = {self.toJSON()}\n'
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
def toJSON(sect):
|
|
26
|
+
js = {
|
|
27
|
+
"SECTTYPE": "DBUSER",
|
|
28
|
+
"SECT_NAME": sect.NAME,
|
|
29
|
+
"SECT_BEFORE": {
|
|
30
|
+
"SHAPE": sect.SHAPE,
|
|
31
|
+
"DATATYPE": sect.DATATYPE,
|
|
32
|
+
"SECT_I": {
|
|
33
|
+
"vSIZE": sect.PARAMS
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
js['SECT_BEFORE'].update(sect.OFFSET.JS)
|
|
38
|
+
js['SECT_BEFORE']['USE_SHEAR_DEFORM'] = sect.USESHEAR
|
|
39
|
+
js['SECT_BEFORE']['USE_WARPING_EFFECT'] = sect.USE7DOF
|
|
40
|
+
return js
|
|
41
|
+
|
|
42
|
+
@staticmethod
|
|
43
|
+
def _objectify(id,name,type,shape,offset,uShear,u7DOF,js):
|
|
44
|
+
return _SS_DBUSER(name,shape,js['SECT_BEFORE']['SECT_I']['vSIZE'],offset,uShear,u7DOF,id)
|
|
45
|
+
|
|
46
|
+
def _centerLine(shape,end):
|
|
47
|
+
if shape.SHAPE == 'SB' :
|
|
48
|
+
H,B = shape.PARAMS[:2]
|
|
49
|
+
|
|
50
|
+
sect_lin_con = [[1,2],[3,1]]
|
|
51
|
+
|
|
52
|
+
sect_cg_LT = [-B/2,H/2]
|
|
53
|
+
sect_cg_CC = [0,0]
|
|
54
|
+
sect_cg_RB = [B/2,-H/2]
|
|
55
|
+
|
|
56
|
+
if H > B :
|
|
57
|
+
sect_shape = [[0,0],[0,H/2],[0,-H/2],[0,H/4],[0,-H/4]]
|
|
58
|
+
sect_thk = [B,B,B,B]
|
|
59
|
+
sect_thk_off = [0,0,0,0]
|
|
60
|
+
else :
|
|
61
|
+
sect_shape = [[0,0],[B/2,0],[-B/2,0],[B/4,0],[-B/4,0]]
|
|
62
|
+
sect_thk = [H,H,H,H]
|
|
63
|
+
sect_thk_off = [0,0,0,0]
|
|
64
|
+
|
|
65
|
+
elif shape.SHAPE == 'L' :
|
|
66
|
+
H,B,tw,tf = shape.PARAMS[:4]
|
|
67
|
+
|
|
68
|
+
sect_cg_LT = [0,0]
|
|
69
|
+
sect_cg_CC = [(H*tw*tw+B*B*tf)/(2*(B*tw+H*tf)),-(H*H*tw+B*tf*tf)/(2*(B*tw+H*tf))]
|
|
70
|
+
sect_cg_RB = [B,-H]
|
|
71
|
+
|
|
72
|
+
# sect_shape = [[0.5*tw,-H],[0.5*tw,-0.5*tf],[B,-0.5*tf]]
|
|
73
|
+
sect_shape = [[0,-H],[0,0],[B,0]]
|
|
74
|
+
sect_lin_con = [[3,2],[2,1]]
|
|
75
|
+
sect_thk = [tw,tf]
|
|
76
|
+
# sect_thk_off = [0,0]
|
|
77
|
+
sect_thk_off = [tw/2,tf/2]
|
|
78
|
+
|
|
79
|
+
elif shape.SHAPE == 'C' :
|
|
80
|
+
H,B1,tw,tf1,B2,tf2 = shape.PARAMS[:6]
|
|
81
|
+
if B2 == 0 : B2 = B1
|
|
82
|
+
if tf2 == 0 : tf2 = tf1
|
|
83
|
+
|
|
84
|
+
sect_cg_LT = [0,0]
|
|
85
|
+
sect_cg_CC = [(B1+B2)*0.2,-H*0.5]
|
|
86
|
+
sect_cg_RB = [max(B1,B2),-H]
|
|
87
|
+
|
|
88
|
+
# sect_shape = [[0.5*tw,-0.5*tf1],[B1,-0.5*tf1],[0.5*tw,-H+0.5*tf2],[B2,-H+0.5*tf2]]
|
|
89
|
+
sect_shape = [[0,0],[B1,0],[0,-H],[B2,-H]]
|
|
90
|
+
sect_lin_con = [[2,1],[1,3],[3,4]]
|
|
91
|
+
sect_thk = [tf1,tw,tf2]
|
|
92
|
+
# sect_thk_off = [0,0,0]
|
|
93
|
+
sect_thk_off = [tf1/2,tw/2,tf2/2]
|
|
94
|
+
|
|
95
|
+
elif shape.SHAPE == 'H' :
|
|
96
|
+
H,B1,tw,tf1,B2,tf2,r1,r2 = shape.PARAMS[:8]
|
|
97
|
+
if B2 == 0 : B2 = B1
|
|
98
|
+
if tf2 == 0 : tf2 = tf1
|
|
99
|
+
|
|
100
|
+
sect_cg_LT = [-0.5*max(B1,B2),0.5*H]
|
|
101
|
+
sect_cg_CC = [0,0]
|
|
102
|
+
sect_cg_RB = [0.5*max(B1,B2),-0.5*H]
|
|
103
|
+
|
|
104
|
+
sect_shape = [[-0.5*B1,0.5*(H-tf1)],[0,0.5*(H-tf1)],[0.5*B1,0.5*(H-tf1)],[-0.5*B2,-0.5*(H-tf2)],[0,-0.5*(H-tf2)],[0.5*B2,-0.5*(H-tf2)]]
|
|
105
|
+
sect_lin_con = [[2,1],[3,2],[2,5],[4,5],[5,6]]
|
|
106
|
+
sect_thk = [tf1,tf1,tw,tf2,tf2]
|
|
107
|
+
sect_thk_off = [0,0,0,0,0]
|
|
108
|
+
|
|
109
|
+
elif shape.SHAPE == 'T' :
|
|
110
|
+
H,B,tw,tf = shape.PARAMS[:4]
|
|
111
|
+
|
|
112
|
+
sect_cg_LT = [-B*0.5,0]
|
|
113
|
+
sect_cg_CC = [0,-H*0.3]
|
|
114
|
+
sect_cg_RB = [B*0.5,-H]
|
|
115
|
+
|
|
116
|
+
sect_shape = [[-0.5*B,-0.5*tf],[0,-0.5*tf],[0.5*B,-0.5*tf],[0,-H]]
|
|
117
|
+
sect_lin_con = [[2,1],[3,2],[2,4]]
|
|
118
|
+
sect_thk = [tf,tf,tw]
|
|
119
|
+
sect_thk_off = [0,0,0]
|
|
120
|
+
|
|
121
|
+
elif shape.SHAPE == 'B' :
|
|
122
|
+
H,B,tw,tf1,C,tf2 = shape.PARAMS[:6]
|
|
123
|
+
if tf2 == 0 : tf2 = tf1
|
|
124
|
+
|
|
125
|
+
sect_cg_LT = [-0.5*B,0.5*H]
|
|
126
|
+
sect_cg_CC = [0,0]
|
|
127
|
+
sect_cg_RB = [0.5*B,-0.5*H]
|
|
128
|
+
|
|
129
|
+
# sect_shape = [[0.5*(B-tw),0.5*(H-tf1)],[-0.5*(B-tw),0.5*(H-tf1)],[-0.5*(B-tw),-0.5*(H-tf2)],[0.5*(B-tw),-0.5*(H-tf2)]]
|
|
130
|
+
sect_shape = [[0.5*B,0.5*H],[-0.5*B,0.5*H],[-0.5*B,-0.5*H],[0.5*B,-0.5*H]]
|
|
131
|
+
|
|
132
|
+
sect_lin_con = [[1,2],[2,3],[3,4],[4,1]]
|
|
133
|
+
sect_thk = [tf1,tw,tf2,tw]
|
|
134
|
+
# sect_thk_off = [0,0,0,0]
|
|
135
|
+
sect_thk_off = [0.5*tf1,0.5*tw,0.5*tf2,0.5*tw]
|
|
136
|
+
|
|
137
|
+
elif shape.SHAPE == 'P' :
|
|
138
|
+
D,tw = shape.PARAMS[:2]
|
|
139
|
+
|
|
140
|
+
# R = 0.5*(D-tw)
|
|
141
|
+
R = 0.5*D
|
|
142
|
+
|
|
143
|
+
sect_cg_LT = [-R,R]
|
|
144
|
+
sect_cg_CC = [0,0]
|
|
145
|
+
sect_cg_RB = [R,-R]
|
|
146
|
+
|
|
147
|
+
sect_shape = []
|
|
148
|
+
sect_lin_con = []
|
|
149
|
+
sect_thk = []
|
|
150
|
+
sect_thk_off = []
|
|
151
|
+
|
|
152
|
+
n = 16
|
|
153
|
+
for i in range(n):
|
|
154
|
+
sect_shape.append([R*math.sin(i*2*math.pi/n),R*math.cos(i*2*math.pi/n)])
|
|
155
|
+
sect_lin_con.append([i+1,i+2])
|
|
156
|
+
sect_thk.append(tw)
|
|
157
|
+
sect_thk_off.append(-0.5*tw)
|
|
158
|
+
sect_lin_con[-1] = [i+1,1]
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
sect_cg = (sect_cg_LT,sect_cg_CC,sect_cg_RB)
|
|
163
|
+
|
|
164
|
+
return sect_shape, sect_thk ,sect_thk_off, sect_cg , sect_lin_con
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
from ._offsetSS import Offset
|
|
2
2
|
from ._offsetSS import _common
|
|
3
|
+
import math
|
|
3
4
|
|
|
4
5
|
|
|
5
6
|
|
|
@@ -114,6 +115,35 @@ class _SS_PSC_12CELL(_common):
|
|
|
114
115
|
vD[0],vD[1],vD[2],vD[3],vD[4],vD[5],vD[6],vD[7],
|
|
115
116
|
offset,uShear,u7DOF,id)
|
|
116
117
|
|
|
118
|
+
def _centerLine(shape,end):
|
|
119
|
+
if shape.SHAPE == '1CEL':
|
|
120
|
+
BO1 = shape.BO1
|
|
121
|
+
BO2 = shape.BO2
|
|
122
|
+
BO3 = shape.BO3
|
|
123
|
+
HO1 = shape.HO1
|
|
124
|
+
HO2 = shape.HO2
|
|
125
|
+
HO3 = shape.HO3
|
|
126
|
+
HI1 = shape.HI1
|
|
127
|
+
HI5 = shape.HI5
|
|
128
|
+
BI3 = shape.BI3
|
|
129
|
+
|
|
130
|
+
sect_lin_con = [[1,2],[2,3],[3,4],[2,5],[3,6],[5,6]]
|
|
131
|
+
|
|
132
|
+
sect_cg_LT = [0,0]
|
|
133
|
+
sect_cg_RB = [2*(BO1+BO2+BO3),-(HO1+HO2+HO3)]
|
|
134
|
+
sect_cg_CC = [(BO1+BO2+BO3),-(HO1+HO2+HO3)/2]
|
|
135
|
+
|
|
136
|
+
sect_shape = [[0,0],[BO1,0],[BO1+2*(BO2+BO3),0],[2*(BO1+BO2+BO3),0],[BO1+BO2,-HO1-HO3-HO2],[BO1+BO2+2*BO3,-HO1-HO3-HO2]]
|
|
137
|
+
sect_thk = [HO1,HI1,HO1,BO3-BI3,BO3-BI3,HI5]
|
|
138
|
+
sect_thk_off = [-HO1/2,-HI1/2,-HO1/2,(BO3-BI3)/2,-(BO3-BI3)/2,HI5/2]
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
sect_cg = (sect_cg_LT,sect_cg_CC,sect_cg_RB)
|
|
143
|
+
|
|
144
|
+
return sect_shape, sect_thk ,sect_thk_off, sect_cg , sect_lin_con
|
|
145
|
+
|
|
146
|
+
|
|
117
147
|
|
|
118
148
|
|
|
119
149
|
|
|
@@ -761,7 +761,7 @@ class Tendon:
|
|
|
761
761
|
array_temp.append({
|
|
762
762
|
'PT' : [self.P_XYZ[j].X,self.P_XYZ[j].Y,self.P_XYZ[j].Z],
|
|
763
763
|
'bFIX' : self.bFIX[j],
|
|
764
|
-
'
|
|
764
|
+
'RADIUS' : self.RADIUS[j]
|
|
765
765
|
})
|
|
766
766
|
else:
|
|
767
767
|
for j in range(len(self.P_XYZ)):
|
|
@@ -772,6 +772,8 @@ class Tendon:
|
|
|
772
772
|
})
|
|
773
773
|
|
|
774
774
|
|
|
775
|
+
|
|
776
|
+
|
|
775
777
|
# --- 3D Main ----
|
|
776
778
|
|
|
777
779
|
json_prof = {
|
|
@@ -86,4 +86,12 @@ def zz_add_to_dict(dictionary, key, value):
|
|
|
86
86
|
def _convItem2List(item):
|
|
87
87
|
if isinstance(item,list):
|
|
88
88
|
return item
|
|
89
|
-
return [item]
|
|
89
|
+
return [item]
|
|
90
|
+
|
|
91
|
+
def _matchArray(A,B):
|
|
92
|
+
A = _convItem2List(A)
|
|
93
|
+
B = _convItem2List(B)
|
|
94
|
+
n = len(A)
|
|
95
|
+
if len(B) >= n:
|
|
96
|
+
return B[:n]
|
|
97
|
+
return B + [B[-1]] * (n - len(B))
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: midas_civil
|
|
3
|
-
Version: 1.0
|
|
3
|
+
Version: 1.1.0
|
|
4
4
|
Summary: Python library for MIDAS Civil NX
|
|
5
5
|
Home-page: https://github.com/MIDASIT-Co-Ltd/midas-civil-python
|
|
6
6
|
Author: Sumit Shekhar
|
|
@@ -14,6 +14,7 @@ Requires-Dist: polars
|
|
|
14
14
|
Requires-Dist: xlsxwriter
|
|
15
15
|
Requires-Dist: requests
|
|
16
16
|
Requires-Dist: scipy
|
|
17
|
+
Requires-Dist: colorama
|
|
17
18
|
Dynamic: author
|
|
18
19
|
Dynamic: author-email
|
|
19
20
|
Dynamic: description
|
|
@@ -5,7 +5,7 @@ with open('README.md','r') as f:
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
setup(name='midas_civil',
|
|
8
|
-
version='1.0
|
|
8
|
+
version='1.1.0',
|
|
9
9
|
description='Python library for MIDAS Civil NX',
|
|
10
10
|
author='Sumit Shekhar',
|
|
11
11
|
author_email='sumit.midasit@gmail.com',
|
|
@@ -15,7 +15,8 @@ setup(name='midas_civil',
|
|
|
15
15
|
'polars',
|
|
16
16
|
'xlsxwriter',
|
|
17
17
|
'requests',
|
|
18
|
-
'scipy'
|
|
18
|
+
'scipy',
|
|
19
|
+
'colorama'
|
|
19
20
|
],
|
|
20
21
|
long_description= description,
|
|
21
22
|
long_description_content_type='text/markdown',
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import requests
|
|
2
|
-
from ._mapi import *
|
|
3
|
-
_version_ = "1.0.8"
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
print('')
|
|
7
|
-
print('*'*20,' MIDAS CIVIL-NX PYTHON LIBRARY v',_version_,' 🐍 ','*'*20)
|
|
8
|
-
print('')
|
|
9
|
-
|
|
10
|
-
if NX.version_check:
|
|
11
|
-
resp = requests.get("https://pypi.org/pypi/midas_civil/json").json()
|
|
12
|
-
latest_ver = resp["info"]["version"]
|
|
13
|
-
if _version_ != latest_ver:
|
|
14
|
-
print(
|
|
15
|
-
f"⚠️ Warning: You are using v{_version_}, "
|
|
16
|
-
f"but the latest available version is v{latest_ver}.\n"
|
|
17
|
-
f" Run 'pip install midas_civil --upgrade' to update."
|
|
18
|
-
)
|
|
19
|
-
print("-"*85)
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
from ._model import *
|
|
23
|
-
from ._boundary import *
|
|
24
|
-
from ._utils import *
|
|
25
|
-
from ._node import *
|
|
26
|
-
from ._element import *
|
|
27
|
-
from ._load import *
|
|
28
|
-
from ._group import *
|
|
29
|
-
from ._result import *
|
|
30
|
-
|
|
31
|
-
#--- TESTING IMPORTS ---
|
|
32
|
-
from ._material import *
|
|
33
|
-
|
|
34
|
-
# from ._section import *
|
|
35
|
-
from ._section import *
|
|
36
|
-
|
|
37
|
-
from ._result_extract import *
|
|
38
|
-
from ._construction import *
|
|
39
|
-
from ._thickness import *
|
|
40
|
-
from ._temperature import *
|
|
41
|
-
|
|
42
|
-
from ._tendon import *
|
|
43
|
-
from ._view import *
|
|
44
|
-
|
|
45
|
-
from ._movingload import *
|
|
46
|
-
from ._settlement import *
|
|
47
|
-
from ._analysiscontrol import *
|
|
48
|
-
from ._BoundaryChangeAssignment import*
|
|
49
|
-
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
from ._offsetSS import Offset
|
|
2
|
-
from ._offsetSS import _common
|
|
3
|
-
|
|
4
|
-
class _SS_TAPERED_DBUSER(_common):
|
|
5
|
-
|
|
6
|
-
""" Create Standard USER DEFINED sections"""
|
|
7
|
-
|
|
8
|
-
def __init__(self,Name='',Shape='',params_I:list=[],params_J:list=[],Offset=Offset(),useShear=True,use7Dof=False,id:int=0):
|
|
9
|
-
""" Shape = 'SB' 'SR' for rectangle \n For cylinder"""
|
|
10
|
-
self.ID = id
|
|
11
|
-
self.NAME = Name
|
|
12
|
-
self.TYPE = 'TAPERED'
|
|
13
|
-
self.SHAPE = Shape
|
|
14
|
-
self.PARAMS_I = params_I
|
|
15
|
-
self.PARAMS_J = params_J
|
|
16
|
-
self.OFFSET = Offset
|
|
17
|
-
self.USESHEAR = useShear
|
|
18
|
-
self.USE7DOF = use7Dof
|
|
19
|
-
self.DATATYPE = 2
|
|
20
|
-
|
|
21
|
-
def __str__(self):
|
|
22
|
-
return f' > ID = {self.ID} | USER DEFINED STANDARD SECTION \nJSON = {self.toJSON()}\n'
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
def toJSON(sect):
|
|
26
|
-
js = {
|
|
27
|
-
"SECTTYPE": sect.TYPE,
|
|
28
|
-
"SECT_NAME": sect.NAME,
|
|
29
|
-
"SECT_BEFORE": {
|
|
30
|
-
"SHAPE": sect.SHAPE,
|
|
31
|
-
"TYPE": sect.DATATYPE,
|
|
32
|
-
"SECT_I": {
|
|
33
|
-
"vSIZE": sect.PARAMS_I
|
|
34
|
-
},
|
|
35
|
-
"SECT_J": {
|
|
36
|
-
"vSIZE": sect.PARAMS_J
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
js['SECT_BEFORE'].update(sect.OFFSET.JS)
|
|
41
|
-
js['SECT_BEFORE']['USE_SHEAR_DEFORM'] = sect.USESHEAR
|
|
42
|
-
js['SECT_BEFORE']['USE_WARPING_EFFECT'] = sect.USE7DOF
|
|
43
|
-
return js
|
|
44
|
-
|
|
45
|
-
@staticmethod
|
|
46
|
-
def _objectify(id,name,type,shape,offset,uShear,u7DOF,js):
|
|
47
|
-
return _SS_TAPERED_DBUSER(name,shape,js['SECT_BEFORE']['SECT_I']['vSIZE'],js['SECT_BEFORE']['SECT_J']['vSIZE'],offset,uShear,u7DOF,id)
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
from ._offsetSS import Offset
|
|
2
|
-
from ._offsetSS import _common
|
|
3
|
-
|
|
4
|
-
class _SS_DBUSER(_common):
|
|
5
|
-
|
|
6
|
-
""" Create Standard USER DEFINED sections"""
|
|
7
|
-
|
|
8
|
-
def __init__(self,Name='',Shape='',parameters:list=[],Offset=Offset(),useShear=True,use7Dof=False,id:int=0):
|
|
9
|
-
""" Shape = 'SB' 'SR' for rectangle \n For cylinder"""
|
|
10
|
-
self.ID = id
|
|
11
|
-
self.NAME = Name
|
|
12
|
-
self.TYPE = 'DBUSER'
|
|
13
|
-
self.SHAPE = Shape
|
|
14
|
-
self.PARAMS = parameters
|
|
15
|
-
self.OFFSET = Offset
|
|
16
|
-
self.USESHEAR = useShear
|
|
17
|
-
self.USE7DOF = use7Dof
|
|
18
|
-
self.DATATYPE = 2
|
|
19
|
-
|
|
20
|
-
def __str__(self):
|
|
21
|
-
return f' > ID = {self.ID} | USER DEFINED STANDARD SECTION \nJSON = {self.toJSON()}\n'
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
def toJSON(sect):
|
|
25
|
-
js = {
|
|
26
|
-
"SECTTYPE": "DBUSER",
|
|
27
|
-
"SECT_NAME": sect.NAME,
|
|
28
|
-
"SECT_BEFORE": {
|
|
29
|
-
"SHAPE": sect.SHAPE,
|
|
30
|
-
"DATATYPE": sect.DATATYPE,
|
|
31
|
-
"SECT_I": {
|
|
32
|
-
"vSIZE": sect.PARAMS
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
js['SECT_BEFORE'].update(sect.OFFSET.JS)
|
|
37
|
-
js['SECT_BEFORE']['USE_SHEAR_DEFORM'] = sect.USESHEAR
|
|
38
|
-
js['SECT_BEFORE']['USE_WARPING_EFFECT'] = sect.USE7DOF
|
|
39
|
-
return js
|
|
40
|
-
|
|
41
|
-
@staticmethod
|
|
42
|
-
def _objectify(id,name,type,shape,offset,uShear,u7DOF,js):
|
|
43
|
-
return _SS_DBUSER(name,shape,js['SECT_BEFORE']['SECT_I']['vSIZE'],offset,uShear,u7DOF,id)
|
|
44
|
-
|
|
45
|
-
def _centerLine(shape):
|
|
46
|
-
H = shape.PARAMS[0]
|
|
47
|
-
B = shape.PARAMS[1]
|
|
48
|
-
tw = shape.PARAMS[2]
|
|
49
|
-
tf = shape.PARAMS[3]
|
|
50
|
-
|
|
51
|
-
sect_lin_con = [[1,2],[3,1]]
|
|
52
|
-
|
|
53
|
-
sect_cg = [0,0]
|
|
54
|
-
|
|
55
|
-
sect_shape = [[0,0],[B,0],[0,-H]]
|
|
56
|
-
sect_thk = [tf,tw]
|
|
57
|
-
sect_thk_off = [-tf/2,-tw/2]
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|