midas-civil 0.0.9__py3-none-any.whl → 0.1.1__py3-none-any.whl
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/__init__.py +6 -4
- midas_civil/_boundary.py +8 -2
- midas_civil/_construction.py +385 -381
- midas_civil/_construction_backup.py +415 -0
- midas_civil/_element.py +43 -14
- midas_civil/_group.py +22 -1
- midas_civil/_load.py +325 -2
- midas_civil/_material.py +10 -10
- midas_civil/_model.py +38 -0
- midas_civil/_result copy.py +488 -0
- midas_civil/_result.py +30 -363
- midas_civil/_result_extract.py +115 -25
- midas_civil/_temperature.py +353 -0
- midas_civil/_tendon.py +204 -0
- midas_civil/_view.py +26 -0
- {midas_civil-0.0.9.dist-info → midas_civil-0.1.1.dist-info}/METADATA +1 -1
- midas_civil-0.1.1.dist-info/RECORD +25 -0
- midas_civil-0.0.9.dist-info/RECORD +0 -20
- {midas_civil-0.0.9.dist-info → midas_civil-0.1.1.dist-info}/WHEEL +0 -0
- {midas_civil-0.0.9.dist-info → midas_civil-0.1.1.dist-info}/licenses/LICENSE +0 -0
- {midas_civil-0.0.9.dist-info → midas_civil-0.1.1.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,353 @@
|
|
|
1
|
+
from ._mapi import *
|
|
2
|
+
from ._node import *
|
|
3
|
+
from ._group import *
|
|
4
|
+
|
|
5
|
+
def convList(item):
|
|
6
|
+
if type(item) != list:
|
|
7
|
+
return [item]
|
|
8
|
+
else:
|
|
9
|
+
return item
|
|
10
|
+
|
|
11
|
+
class Temperature:
|
|
12
|
+
|
|
13
|
+
@classmethod
|
|
14
|
+
def create(cls):
|
|
15
|
+
"""Creates Temperature elements in MIDAS Civil NX"""
|
|
16
|
+
if cls.System.temps: cls.System.create()
|
|
17
|
+
if cls.Element.temps: cls.Element.create()
|
|
18
|
+
if cls.Gradient.temps: cls.Gradient.create()
|
|
19
|
+
|
|
20
|
+
@classmethod
|
|
21
|
+
def delete(cls):
|
|
22
|
+
"""Deletes Temperature elements from MIDAS Civil NX and Python"""
|
|
23
|
+
cls.System.delete()
|
|
24
|
+
cls.Element.delete()
|
|
25
|
+
cls.Gradient.delete()
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
@classmethod
|
|
29
|
+
def sync(cls):
|
|
30
|
+
"""Sync Temperature elements from MIDAS Civil NX to Python"""
|
|
31
|
+
cls.System.sync()
|
|
32
|
+
cls.Element.sync()
|
|
33
|
+
cls.Gradient.sync()
|
|
34
|
+
|
|
35
|
+
# --------------------------------------------------------------------------------------------------
|
|
36
|
+
# System Temperature
|
|
37
|
+
# --------------------------------------------------------------------------------------------------
|
|
38
|
+
class System:
|
|
39
|
+
"""
|
|
40
|
+
Create System Temperature Object in Python
|
|
41
|
+
|
|
42
|
+
Parameters:
|
|
43
|
+
temperature (float): Temperature value
|
|
44
|
+
lcname (str): Load case name
|
|
45
|
+
group (str): Load group name (default "")
|
|
46
|
+
id (int): System ID (optional)
|
|
47
|
+
|
|
48
|
+
Example:
|
|
49
|
+
Temperature.System(12.5, "Temp(+)", "LoadGroup1", 1)
|
|
50
|
+
"""
|
|
51
|
+
temps = []
|
|
52
|
+
|
|
53
|
+
def __init__(self, temperature, lcname, group="", id=None):
|
|
54
|
+
if group:
|
|
55
|
+
chk = 0
|
|
56
|
+
try:
|
|
57
|
+
a = [v['NAME'] for v in Group.Load.json()["Assign"].values()]
|
|
58
|
+
if group in a:
|
|
59
|
+
chk = 1
|
|
60
|
+
except:
|
|
61
|
+
pass
|
|
62
|
+
if chk == 0:
|
|
63
|
+
Group.Load(group)
|
|
64
|
+
|
|
65
|
+
self.TEMPER = temperature
|
|
66
|
+
self.LCNAME = lcname
|
|
67
|
+
self.GROUP_NAME = group
|
|
68
|
+
|
|
69
|
+
if id is None:
|
|
70
|
+
self.ID = len(Temperature.System.temps) + 1
|
|
71
|
+
else:
|
|
72
|
+
self.ID = id
|
|
73
|
+
|
|
74
|
+
Temperature.System.temps.append(self)
|
|
75
|
+
|
|
76
|
+
@classmethod
|
|
77
|
+
def json(cls):
|
|
78
|
+
"""Creates JSON from System Temperature objects defined in Python"""
|
|
79
|
+
json_data = {"Assign": {}}
|
|
80
|
+
for temp in cls.temps:
|
|
81
|
+
json_data["Assign"][str(temp.ID)] = {
|
|
82
|
+
"TEMPER": temp.TEMPER,
|
|
83
|
+
"LCNAME": temp.LCNAME,
|
|
84
|
+
"GROUP_NAME": temp.GROUP_NAME
|
|
85
|
+
}
|
|
86
|
+
return json_data
|
|
87
|
+
|
|
88
|
+
@staticmethod
|
|
89
|
+
def create():
|
|
90
|
+
"""Creates System Temperatures in MIDAS Civil NX"""
|
|
91
|
+
MidasAPI("PUT", "/db/stmp", Temperature.System.json())
|
|
92
|
+
|
|
93
|
+
@staticmethod
|
|
94
|
+
def get():
|
|
95
|
+
"""Get the JSON of System Temperatures from MIDAS Civil NX"""
|
|
96
|
+
return MidasAPI("GET", "/db/stmp")
|
|
97
|
+
|
|
98
|
+
@staticmethod
|
|
99
|
+
def sync():
|
|
100
|
+
"""Sync System Temperatures from MIDAS Civil NX to Python"""
|
|
101
|
+
Temperature.System.temps = []
|
|
102
|
+
a = Temperature.System.get()
|
|
103
|
+
|
|
104
|
+
if a and 'STMP' in a:
|
|
105
|
+
temp_data = a.get('STMP', {})
|
|
106
|
+
for temp_id, temp_info in temp_data.items():
|
|
107
|
+
Temperature.System(
|
|
108
|
+
temp_info.get('TEMPER', 0),
|
|
109
|
+
temp_info.get('LCNAME', ''),
|
|
110
|
+
temp_info.get('GROUP_NAME', ''),
|
|
111
|
+
int(temp_id)
|
|
112
|
+
)
|
|
113
|
+
|
|
114
|
+
@staticmethod
|
|
115
|
+
def delete():
|
|
116
|
+
"""Delete System Temperatures from MIDAS Civil NX and Python"""
|
|
117
|
+
Temperature.System.temps = []
|
|
118
|
+
return MidasAPI("DELETE", "/db/stmp")
|
|
119
|
+
|
|
120
|
+
# --------------------------------------------------------------------------------------------------
|
|
121
|
+
# Element Temperature
|
|
122
|
+
# --------------------------------------------------------------------------------------------------
|
|
123
|
+
class Element:
|
|
124
|
+
"""
|
|
125
|
+
Create Element Temperature Object in Python
|
|
126
|
+
|
|
127
|
+
Parameters:
|
|
128
|
+
element (int): Element ID
|
|
129
|
+
temperature (float): Temperature value
|
|
130
|
+
lcname (str): Load case name
|
|
131
|
+
group (str): Load group name (default "")
|
|
132
|
+
id (int): Temperature ID (optional)
|
|
133
|
+
|
|
134
|
+
Example:
|
|
135
|
+
Temperature.Element(1, 35, "Temp(+)", "", 1)
|
|
136
|
+
"""
|
|
137
|
+
temps = []
|
|
138
|
+
|
|
139
|
+
def __init__(self, element, temperature, lcname, group="", id=None):
|
|
140
|
+
if group:
|
|
141
|
+
chk = 0
|
|
142
|
+
try:
|
|
143
|
+
a = [v['NAME'] for v in Group.Load.json()["Assign"].values()]
|
|
144
|
+
if group in a:
|
|
145
|
+
chk = 1
|
|
146
|
+
except:
|
|
147
|
+
pass
|
|
148
|
+
if chk == 0:
|
|
149
|
+
Group.Load(group)
|
|
150
|
+
|
|
151
|
+
self.ELEMENT = element
|
|
152
|
+
self.TEMP = temperature
|
|
153
|
+
self.LCNAME = lcname
|
|
154
|
+
self.GROUP_NAME = group
|
|
155
|
+
|
|
156
|
+
if id is None:
|
|
157
|
+
existing_ids = []
|
|
158
|
+
for temp in Temperature.Element.temps:
|
|
159
|
+
if temp.ELEMENT == element:
|
|
160
|
+
existing_ids.extend([item.get('ID', 0) for item in temp.ITEMS if hasattr(temp, 'ITEMS')])
|
|
161
|
+
self.ID = max(existing_ids, default=0) + 1
|
|
162
|
+
else:
|
|
163
|
+
self.ID = id
|
|
164
|
+
|
|
165
|
+
existing_temp = None
|
|
166
|
+
for temp in Temperature.Element.temps:
|
|
167
|
+
if temp.ELEMENT == element:
|
|
168
|
+
existing_temp = temp
|
|
169
|
+
break
|
|
170
|
+
|
|
171
|
+
item_data = {
|
|
172
|
+
"ID": self.ID, "LCNAME": self.LCNAME,
|
|
173
|
+
"GROUP_NAME": self.GROUP_NAME, "TEMP": self.TEMP
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
if existing_temp:
|
|
177
|
+
if not hasattr(existing_temp, 'ITEMS'):
|
|
178
|
+
existing_temp.ITEMS = []
|
|
179
|
+
existing_temp.ITEMS.append(item_data)
|
|
180
|
+
else:
|
|
181
|
+
self.ITEMS = [item_data]
|
|
182
|
+
Temperature.Element.temps.append(self)
|
|
183
|
+
|
|
184
|
+
@classmethod
|
|
185
|
+
def json(cls):
|
|
186
|
+
"""Creates JSON from Element Temperature objects defined in Python"""
|
|
187
|
+
json_data = {"Assign": {}}
|
|
188
|
+
for temp in cls.temps:
|
|
189
|
+
json_data["Assign"][str(temp.ELEMENT)] = {"ITEMS": temp.ITEMS}
|
|
190
|
+
return json_data
|
|
191
|
+
|
|
192
|
+
@staticmethod
|
|
193
|
+
def create():
|
|
194
|
+
"""Creates Element Temperatures in MIDAS Civil NX"""
|
|
195
|
+
MidasAPI("PUT", "/db/etmp", Temperature.Element.json())
|
|
196
|
+
|
|
197
|
+
@staticmethod
|
|
198
|
+
def get():
|
|
199
|
+
"""Get the JSON of Element Temperatures from MIDAS Civil NX"""
|
|
200
|
+
return MidasAPI("GET", "/db/etmp")
|
|
201
|
+
|
|
202
|
+
@staticmethod
|
|
203
|
+
def sync():
|
|
204
|
+
"""Sync Element Temperatures from MIDAS Civil NX to Python"""
|
|
205
|
+
Temperature.Element.temps = []
|
|
206
|
+
a = Temperature.Element.get()
|
|
207
|
+
|
|
208
|
+
if a and 'ETMP' in a:
|
|
209
|
+
temp_data = a.get('ETMP', {})
|
|
210
|
+
for element_id, element_data in temp_data.items():
|
|
211
|
+
element_obj = type('obj', (object,), {
|
|
212
|
+
'ELEMENT': int(element_id),
|
|
213
|
+
'ITEMS': element_data.get('ITEMS', [])
|
|
214
|
+
})()
|
|
215
|
+
Temperature.Element.temps.append(element_obj)
|
|
216
|
+
|
|
217
|
+
@staticmethod
|
|
218
|
+
def delete():
|
|
219
|
+
"""Delete Element Temperatures from MIDAS Civil NX and Python"""
|
|
220
|
+
Temperature.Element.temps = []
|
|
221
|
+
return MidasAPI("DELETE", "/db/etmp")
|
|
222
|
+
|
|
223
|
+
# --------------------------------------------------------------------------------------------------
|
|
224
|
+
# Temperature Gradient
|
|
225
|
+
# --------------------------------------------------------------------------------------------------
|
|
226
|
+
class Gradient:
|
|
227
|
+
"""
|
|
228
|
+
Create Temperature Gradient Object in Python for Beam and Plate elements.
|
|
229
|
+
|
|
230
|
+
Parameters:
|
|
231
|
+
element (int): Element ID to apply the gradient.
|
|
232
|
+
type (str): Element type, either 'Beam' or 'Plate'.
|
|
233
|
+
lcname (str): Load Case Name (must exist in the model).
|
|
234
|
+
tz (float): Temperature difference in the local z-direction (T2z - T1z).
|
|
235
|
+
group (str, optional): Load Group Name. Defaults to "".
|
|
236
|
+
id (int, optional): Gradient ID. Auto-assigned if not provided.
|
|
237
|
+
hz (float, optional): Gradient value for local z-dir. If omitted, section default is used.
|
|
238
|
+
ty (float, optional): Temp. diff. in local y-dir (T2y - T1y). **Required for 'Beam' type.**
|
|
239
|
+
hy (float, optional): Gradient value for local y-dir. If omitted, section default is used.
|
|
240
|
+
|
|
241
|
+
Example for Beam (providing gradient values):
|
|
242
|
+
Temperature.Gradient(element=2, type='Beam', lcname='Temp(-)', tz=10, ty=-10, hz=1.2, hy=0.5)
|
|
243
|
+
|
|
244
|
+
Example for Beam (using section defaults):
|
|
245
|
+
Temperature.Gradient(element=2, type='Beam', lcname='Temp(+)', tz=10, ty=-10)
|
|
246
|
+
|
|
247
|
+
Example for Plate (providing gradient value):
|
|
248
|
+
Temperature.Gradient(element=21, type='Plate', lcname='Temp(-)', tz=10, hz=0.2)
|
|
249
|
+
"""
|
|
250
|
+
temps = []
|
|
251
|
+
|
|
252
|
+
def __init__(self, element, type, lcname, tz, group="", id=None, hz=None, ty=0, hy=None):
|
|
253
|
+
if group:
|
|
254
|
+
chk = 0
|
|
255
|
+
try:
|
|
256
|
+
a = [v['NAME'] for v in Group.Load.json()["Assign"].values()]
|
|
257
|
+
if group in a:
|
|
258
|
+
chk = 1
|
|
259
|
+
except:
|
|
260
|
+
pass
|
|
261
|
+
if chk == 0:
|
|
262
|
+
Group.Load(group)
|
|
263
|
+
|
|
264
|
+
self.ELEMENT = element
|
|
265
|
+
|
|
266
|
+
if id is None:
|
|
267
|
+
existing_ids = []
|
|
268
|
+
for temp in Temperature.Gradient.temps:
|
|
269
|
+
if temp.ELEMENT == element:
|
|
270
|
+
existing_ids.extend([item.get('ID', 0) for item in temp.ITEMS if hasattr(temp, 'ITEMS')])
|
|
271
|
+
self.ID = max(existing_ids, default=0) + 1
|
|
272
|
+
else:
|
|
273
|
+
self.ID = id
|
|
274
|
+
|
|
275
|
+
use_hz = (hz is None)
|
|
276
|
+
use_hy = (hy is None)
|
|
277
|
+
|
|
278
|
+
item_data = {
|
|
279
|
+
"ID": self.ID,
|
|
280
|
+
"LCNAME": lcname,
|
|
281
|
+
"GROUP_NAME": group,
|
|
282
|
+
"TZ": tz,
|
|
283
|
+
"USE_HZ": use_hz,
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
if not use_hz:
|
|
287
|
+
item_data["HZ"] = hz
|
|
288
|
+
|
|
289
|
+
if type.lower() == 'beam':
|
|
290
|
+
item_data["TYPE"] = 1
|
|
291
|
+
item_data["TY"] = ty
|
|
292
|
+
item_data["USE_HY"] = use_hy
|
|
293
|
+
if not use_hy:
|
|
294
|
+
item_data["HY"] = hy
|
|
295
|
+
elif type.lower() == 'plate':
|
|
296
|
+
item_data["TYPE"] = 2
|
|
297
|
+
else:
|
|
298
|
+
raise ValueError("Element type for Gradient must be 'Beam' or 'Plate'.")
|
|
299
|
+
|
|
300
|
+
existing_temp = None
|
|
301
|
+
for temp in Temperature.Gradient.temps:
|
|
302
|
+
if temp.ELEMENT == element:
|
|
303
|
+
existing_temp = temp
|
|
304
|
+
break
|
|
305
|
+
|
|
306
|
+
if existing_temp:
|
|
307
|
+
if not hasattr(existing_temp, 'ITEMS'):
|
|
308
|
+
existing_temp.ITEMS = []
|
|
309
|
+
existing_temp.ITEMS.append(item_data)
|
|
310
|
+
else:
|
|
311
|
+
self.ITEMS = [item_data]
|
|
312
|
+
Temperature.Gradient.temps.append(self)
|
|
313
|
+
|
|
314
|
+
@classmethod
|
|
315
|
+
def json(cls):
|
|
316
|
+
"""Creates JSON from Temperature Gradient objects defined in Python"""
|
|
317
|
+
json_data = {"Assign": {}}
|
|
318
|
+
for temp in cls.temps:
|
|
319
|
+
json_data["Assign"][str(temp.ELEMENT)] = {"ITEMS": temp.ITEMS}
|
|
320
|
+
return json_data
|
|
321
|
+
|
|
322
|
+
@staticmethod
|
|
323
|
+
def create():
|
|
324
|
+
"""Creates Temperature Gradients in MIDAS Civil NX"""
|
|
325
|
+
MidasAPI("PUT", "/db/gtmp", Temperature.Gradient.json())
|
|
326
|
+
|
|
327
|
+
@staticmethod
|
|
328
|
+
def get():
|
|
329
|
+
"""Get the JSON of Temperature Gradients from MIDAS Civil NX"""
|
|
330
|
+
return MidasAPI("GET", "/db/gtmp")
|
|
331
|
+
|
|
332
|
+
@staticmethod
|
|
333
|
+
def sync():
|
|
334
|
+
"""Sync Temperature Gradients from MIDAS Civil NX to Python"""
|
|
335
|
+
Temperature.Gradient.temps = []
|
|
336
|
+
a = Temperature.Gradient.get()
|
|
337
|
+
|
|
338
|
+
if a and 'GTMP' in a:
|
|
339
|
+
temp_data = a.get('GTMP', {})
|
|
340
|
+
for element_id, element_data in temp_data.items():
|
|
341
|
+
element_obj = type('obj', (object,), {
|
|
342
|
+
'ELEMENT': int(element_id),
|
|
343
|
+
'ITEMS': element_data.get('ITEMS', [])
|
|
344
|
+
})()
|
|
345
|
+
Temperature.Gradient.temps.append(element_obj)
|
|
346
|
+
|
|
347
|
+
@staticmethod
|
|
348
|
+
def delete():
|
|
349
|
+
"""Delete Temperature Gradients from MIDAS Civil NX and Python"""
|
|
350
|
+
Temperature.Gradient.temps = []
|
|
351
|
+
return MidasAPI("DELETE", "/db/gtmp")
|
|
352
|
+
|
|
353
|
+
# --------------------------------------------------------------------------------------------------
|
midas_civil/_tendon.py
ADDED
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
|
|
2
|
+
from ._mapi import *
|
|
3
|
+
from ._utils import *
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
#5 Class to create nodes
|
|
7
|
+
class Tendon:
|
|
8
|
+
|
|
9
|
+
# ----------------- TENDON PROFILE --------------------------
|
|
10
|
+
class Profile:
|
|
11
|
+
profiles =[]
|
|
12
|
+
ids=[]
|
|
13
|
+
|
|
14
|
+
def __init__(self,name,tdn_prop,tdn_group=0,elem=[],inp_type='3D',curve_type = 'SPLINE',st_len_begin = 0 , st_len_end = 0,n_typical_tendon=0,
|
|
15
|
+
trans_len_opt='USER', trans_len_begin = 0 , trans_len_end = 0, debon_len_begin=0 , debon_len_end=0,
|
|
16
|
+
ref_axis = 'ELEMENT',
|
|
17
|
+
prof_xyz = [], prof_xy =[],prof_xz=[],
|
|
18
|
+
prof_ins_point_end = 'END-I', prof_ins_point_elem = 0, x_axis_dir_element = 'I-J', x_axis_rot_ang = 0 , projection = True, offset_y = 0 , offset_z = 0,
|
|
19
|
+
prof_ins_point =[0,0,0], x_axis_dir_straight = 'X' , x_axis_dir_vec = [0,0], grad_rot_axis = 'X', grad_rot_ang=0,
|
|
20
|
+
radius_cen = [0,0], offset = 0, dir = 'CW',
|
|
21
|
+
id=0):
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
if Tendon.Profile.ids == []:
|
|
26
|
+
td_count = 1
|
|
27
|
+
else:
|
|
28
|
+
td_count = max(Tendon.Profile.ids)+1
|
|
29
|
+
|
|
30
|
+
if id == 0 : self.ID = td_count
|
|
31
|
+
if id != 0 : self.ID = id
|
|
32
|
+
|
|
33
|
+
self.NAME = name
|
|
34
|
+
self.PROP = tdn_prop
|
|
35
|
+
self.GROUP = tdn_group
|
|
36
|
+
self.ELEM = elem
|
|
37
|
+
|
|
38
|
+
if inp_type not in ['2D' , '3D']: inp_type = '3D'
|
|
39
|
+
self.INPUT = inp_type
|
|
40
|
+
|
|
41
|
+
if curve_type not in ['SPLINE' , 'ROUND']: curve_type = 'ROUND'
|
|
42
|
+
self.CURVE = curve_type
|
|
43
|
+
|
|
44
|
+
self.BELENG = st_len_begin
|
|
45
|
+
self.ELENG = st_len_end
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
self.CNT = n_typical_tendon
|
|
49
|
+
if n_typical_tendon > 0:
|
|
50
|
+
self.bTP = True
|
|
51
|
+
else: self.bTP = False
|
|
52
|
+
|
|
53
|
+
if trans_len_opt not in ['USER' , 'AUTO']: trans_len_opt = 'USER'
|
|
54
|
+
self.LENG_OPT = trans_len_opt
|
|
55
|
+
self.BLEN = trans_len_begin
|
|
56
|
+
self.ELEN = trans_len_end
|
|
57
|
+
|
|
58
|
+
self.DeBondBLEN = debon_len_begin
|
|
59
|
+
self.DeBondELEN = debon_len_end
|
|
60
|
+
|
|
61
|
+
if ref_axis not in ['ELEMENT' , 'STRAIGHT' , 'CURVE']: ref_axis = 'ELEMENT'
|
|
62
|
+
self.SHAPE = ref_axis
|
|
63
|
+
|
|
64
|
+
#------- ELEMENT TYPE -------------
|
|
65
|
+
|
|
66
|
+
if prof_ins_point_end not in ['END-I' , 'END-J']: prof_ins_point_end = 'END-I'
|
|
67
|
+
self.INS_PT = prof_ins_point_end
|
|
68
|
+
|
|
69
|
+
if prof_ins_point_elem == 0: prof_ins_point_elem = elem[0]
|
|
70
|
+
self.INS_ELEM = prof_ins_point_elem
|
|
71
|
+
|
|
72
|
+
if x_axis_dir_element not in ['I-J' , 'J-I']: x_axis_dir_element = 'I-J'
|
|
73
|
+
self.AXIS_IJ = x_axis_dir_element
|
|
74
|
+
|
|
75
|
+
self.XAR_ANGLE = x_axis_rot_ang # common in straight
|
|
76
|
+
self.bPJ = projection # common in straight
|
|
77
|
+
|
|
78
|
+
self.OFF_YZ = [offset_y,offset_z]
|
|
79
|
+
|
|
80
|
+
#------- STRAIGHT TYPE -------------
|
|
81
|
+
|
|
82
|
+
self.IP = prof_ins_point
|
|
83
|
+
|
|
84
|
+
if x_axis_dir_straight not in ['X' , 'Y' , 'VECTOR']: x_axis_dir_straight = 'X'
|
|
85
|
+
self.AXIS = x_axis_dir_straight
|
|
86
|
+
|
|
87
|
+
self.VEC = x_axis_dir_vec
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
if grad_rot_axis not in ['X' , 'Y']: grad_rot_axis = 'X'
|
|
91
|
+
self.GR_AXIS = grad_rot_axis
|
|
92
|
+
|
|
93
|
+
self.GR_ANGLE = grad_rot_ang
|
|
94
|
+
|
|
95
|
+
#------- CURVE TYPE -------------
|
|
96
|
+
|
|
97
|
+
self.RC = radius_cen
|
|
98
|
+
self.OFFSET = offset
|
|
99
|
+
|
|
100
|
+
if dir not in ['CW' , 'CCW']: dir = 'CW'
|
|
101
|
+
self.DIR = dir
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
#--------------- PROFILES CREATION -----------------
|
|
106
|
+
x_loc = []
|
|
107
|
+
y_loc = []
|
|
108
|
+
z_loc = []
|
|
109
|
+
bFix = []
|
|
110
|
+
Rd = []
|
|
111
|
+
Rl = []
|
|
112
|
+
|
|
113
|
+
for point in prof_xyz:
|
|
114
|
+
x_loc.append(point[0])
|
|
115
|
+
y_loc.append(point[1])
|
|
116
|
+
z_loc.append(point[2])
|
|
117
|
+
bFix.append(False) # Default not defining here
|
|
118
|
+
if curve_type == 'SPLINE':
|
|
119
|
+
Rd.append([0,0]) # Default not defining here
|
|
120
|
+
else:
|
|
121
|
+
Rl.append(0)
|
|
122
|
+
|
|
123
|
+
#----- 3D Profile -------------
|
|
124
|
+
|
|
125
|
+
self.X = x_loc
|
|
126
|
+
self.Y = y_loc
|
|
127
|
+
self.Z = z_loc
|
|
128
|
+
self.bFIX = bFix
|
|
129
|
+
|
|
130
|
+
self.R = Rd
|
|
131
|
+
self.RADIUS = Rl
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
#----- 2D Profile -------------
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
Tendon.Profile.profiles.append(self)
|
|
141
|
+
Tendon.Profile.ids.append(self.ID)
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
@classmethod
|
|
146
|
+
def json(cls):
|
|
147
|
+
|
|
148
|
+
json = {"Assign":{}}
|
|
149
|
+
|
|
150
|
+
for self in cls.profiles:
|
|
151
|
+
|
|
152
|
+
array_temp = []
|
|
153
|
+
for j in range(len(self.X)):
|
|
154
|
+
array_temp.append({
|
|
155
|
+
'PT' : [self.X[j],self.Y[j],self.Z[j]],
|
|
156
|
+
'bFIX' : self.bFIX[j],
|
|
157
|
+
'R' : self.R[j]
|
|
158
|
+
})
|
|
159
|
+
|
|
160
|
+
json["Assign"][self.ID]={
|
|
161
|
+
'NAME' : self.NAME,
|
|
162
|
+
'TDN_PROP' : self.PROP,
|
|
163
|
+
'ELEM' : self.ELEM,
|
|
164
|
+
'BELENG' : self.BELENG,
|
|
165
|
+
'ELENG' : self.ELENG,
|
|
166
|
+
'CURVE' : self.CURVE,
|
|
167
|
+
'INPUT' : self.INPUT,
|
|
168
|
+
'TDN_GRUP' : self.GROUP,
|
|
169
|
+
"LENG_OPT": self.LENG_OPT,
|
|
170
|
+
"BLEN": self.BLEN,
|
|
171
|
+
"ELEN": self.ELEN,
|
|
172
|
+
"bTP": self.bTP,
|
|
173
|
+
"CNT": self.CNT,
|
|
174
|
+
"DeBondBLEN": self.DeBondBLEN,
|
|
175
|
+
"DeBondELEN": self.DeBondELEN,
|
|
176
|
+
"SHAPE": self.SHAPE,
|
|
177
|
+
"INS_PT": self.INS_PT,
|
|
178
|
+
"INS_ELEM": self.INS_ELEM,
|
|
179
|
+
"AXIS_IJ": self.AXIS_IJ,
|
|
180
|
+
"XAR_ANGLE": self.XAR_ANGLE,
|
|
181
|
+
"bPJ": self.bPJ,
|
|
182
|
+
"OFF_YZ": self.OFF_YZ,
|
|
183
|
+
|
|
184
|
+
"PROF":array_temp
|
|
185
|
+
}
|
|
186
|
+
return json
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
@classmethod
|
|
190
|
+
def create(cls):
|
|
191
|
+
MidasAPI("PUT","/db/TDNA",cls.json())
|
|
192
|
+
|
|
193
|
+
|
|
194
|
+
@classmethod
|
|
195
|
+
def get(cls):
|
|
196
|
+
return MidasAPI('GET','/db/TDNA')
|
|
197
|
+
|
|
198
|
+
@classmethod
|
|
199
|
+
def sync(cls):
|
|
200
|
+
tendon_json = cls.get()
|
|
201
|
+
for id in tendon_json['TDNA']:
|
|
202
|
+
Tendon.Profile(tendon_json['TDNA'][id],id)
|
|
203
|
+
|
|
204
|
+
# --------------------- END CLASSS -----------------------------------------------------
|
midas_civil/_view.py
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
from ._mapi import *
|
|
2
|
+
from ._model import *
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class View:
|
|
7
|
+
|
|
8
|
+
def Capture(location="D:\\API_temp\\img3.jpg",img_w = 1280 , img_h = 720,view='',stage:str=''):
|
|
9
|
+
json_body = {
|
|
10
|
+
"Argument": {
|
|
11
|
+
"EXPORT_PATH": location,
|
|
12
|
+
"HEIGHT": img_h,
|
|
13
|
+
"WIDTH": img_w,
|
|
14
|
+
"ZOOM_LEVEL" : 100
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
if view=='post':
|
|
19
|
+
json_body['Argument']['SET_MODE'] = 'post'
|
|
20
|
+
elif view=='pre':
|
|
21
|
+
json_body['Argument']['SET_MODE'] = 'pre'
|
|
22
|
+
|
|
23
|
+
if stage != '':
|
|
24
|
+
json_body['Argument']['STAGE_NAME'] = stage
|
|
25
|
+
|
|
26
|
+
MidasAPI('POST','/view/CAPTURE',json_body)
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
midas_civil/__init__.py,sha256=ZMBbIpDOrV647HRaVhLuk6G4vdMWSL0tVbZ6eejWIms,520
|
|
2
|
+
midas_civil/_boundary.py,sha256=cF5NIUkk3q11sDnrI1lfebLqelpPyjKF-PgAbI6UU1k,32703
|
|
3
|
+
midas_civil/_construction.py,sha256=EqpJ46w4dqtlmk8dy9ChQq2cF-R2duXcgmpJy4cWLz0,19965
|
|
4
|
+
midas_civil/_construction_backup.py,sha256=Pj7V-NYCkkT-aMjKXfs1jKa9klsGh48UXDLwn3BLYTY,18225
|
|
5
|
+
midas_civil/_element.py,sha256=DhUHJVPwuBkl0AbUOZ6RamEUbAoGiJCKmMbiKbFXOzs,19847
|
|
6
|
+
midas_civil/_group.py,sha256=tUjctPpPz3VLX_1lHFFR85oVyjrrJtn3Caf6zWyBQ6g,10570
|
|
7
|
+
midas_civil/_load.py,sha256=Wg2Cyn7meaCkb28vQSxWi1H1slBQKXdXyoKPGvsHesQ,29557
|
|
8
|
+
midas_civil/_mapi.py,sha256=NImeBj8L7rwrYuaeXbaU3-UnCL4Fyp6tB1wf0UpdQp8,2354
|
|
9
|
+
midas_civil/_material.py,sha256=uJEIHJM9OhwTRWUI2mtd_0BQSxdlYhATYJu9P7tNNBA,69511
|
|
10
|
+
midas_civil/_model.py,sha256=uj_nenNqNLYgwLKB6BZXEPGEByME23gVA5u3EXRZuAA,16337
|
|
11
|
+
midas_civil/_node.py,sha256=yj17RT3Ei7RafWQVHThjwPGUHe3DTQbuv0MwuDjCJro,3513
|
|
12
|
+
midas_civil/_result copy.py,sha256=siTMENLIwF_6rvydSjP9aQAWaIlt0pReiqNyDhDevGk,24290
|
|
13
|
+
midas_civil/_result.py,sha256=0c_lBai5ayvoOK4zD6jBDYBcqixCAljq5qJyZ4koboI,7648
|
|
14
|
+
midas_civil/_result_extract.py,sha256=0Uyhcr2kDUZ4GWIfMgEkcTQacKt5GJcE4jQ_7YgRbBY,5178
|
|
15
|
+
midas_civil/_section.py,sha256=56RWJdyvDr7Es7Is8Fxq3jPCPP57WW8ECCYZzhm6bf0,26375
|
|
16
|
+
midas_civil/_temperature.py,sha256=ZFs5COZh7QFe-xpWNK44u8IqlqMfaOklAo_ZOVAzFok,13047
|
|
17
|
+
midas_civil/_tendon.py,sha256=XDG9gNETffkv6WtjoEHGZu66PQe8iNBS_G6j4miN-Sg,6845
|
|
18
|
+
midas_civil/_thickness.py,sha256=Mungooyfo0_JJUmjPCr25h0PSSW_TtEfcMa-hz3YGZA,3146
|
|
19
|
+
midas_civil/_utils.py,sha256=eymiqO8KaTKdhVY3saebqNS0BbUUmGmgw3-ELKqew0A,2611
|
|
20
|
+
midas_civil/_view.py,sha256=68gfsyN6QJ2B5CopNVlP3MQ-833MxfrVWz7p_hMdm4c,701
|
|
21
|
+
midas_civil-0.1.1.dist-info/licenses/LICENSE,sha256=zrL4RwZC4rb-by_ZHKXwKdIwcs6ATy59TPZ9HxPHCrs,1071
|
|
22
|
+
midas_civil-0.1.1.dist-info/METADATA,sha256=b1o_X2CEMJQn5n2ASJFnuwgKGZTUcqDwaBINc7UDQ9E,1709
|
|
23
|
+
midas_civil-0.1.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
24
|
+
midas_civil-0.1.1.dist-info/top_level.txt,sha256=_NFmrlN5V9OxJ-PAO4s_om8OA8uupXho3QqZcSsnbuI,12
|
|
25
|
+
midas_civil-0.1.1.dist-info/RECORD,,
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
midas_civil/__init__.py,sha256=mq1dqMgS92chPxRbKzoA7X33jpgz5y-8a_CpBvQUmJI,510
|
|
2
|
-
midas_civil/_boundary.py,sha256=VwDgysWvcwlu2gTfEyxPuXqCp4IXKs2NTn3jUz7Brhg,32390
|
|
3
|
-
midas_civil/_construction.py,sha256=Pj7V-NYCkkT-aMjKXfs1jKa9klsGh48UXDLwn3BLYTY,18225
|
|
4
|
-
midas_civil/_element.py,sha256=UbXgad_D_yNgTXWRO1zMP2hQB82BaDdMWvGymrg0L1g,18508
|
|
5
|
-
midas_civil/_group.py,sha256=8iZCIB6XEgFz4Z7QEDU3wd7t18xAtNnqetw5Ch1UOeY,10074
|
|
6
|
-
midas_civil/_load.py,sha256=__qVQgbyfAILyoLv8eDGZ_1uMunzzDG1tUu5zWWD-oA,17213
|
|
7
|
-
midas_civil/_mapi.py,sha256=NImeBj8L7rwrYuaeXbaU3-UnCL4Fyp6tB1wf0UpdQp8,2354
|
|
8
|
-
midas_civil/_material.py,sha256=3dEIafEhdm4s0OXobXZkGYUYYdputNTQ_IyEQ1BTbeY,69478
|
|
9
|
-
midas_civil/_model.py,sha256=wbf3gmFgv0ZB4rphxr-3xLspH-WD7p6aB7PQCNGHA40,14923
|
|
10
|
-
midas_civil/_node.py,sha256=yj17RT3Ei7RafWQVHThjwPGUHe3DTQbuv0MwuDjCJro,3513
|
|
11
|
-
midas_civil/_result.py,sha256=siTMENLIwF_6rvydSjP9aQAWaIlt0pReiqNyDhDevGk,24290
|
|
12
|
-
midas_civil/_result_extract.py,sha256=nYR3cYYZVogVje-Y4Y1Lh1S-lCDs_n-1MCwvkmWk6qA,2454
|
|
13
|
-
midas_civil/_section.py,sha256=56RWJdyvDr7Es7Is8Fxq3jPCPP57WW8ECCYZzhm6bf0,26375
|
|
14
|
-
midas_civil/_thickness.py,sha256=Mungooyfo0_JJUmjPCr25h0PSSW_TtEfcMa-hz3YGZA,3146
|
|
15
|
-
midas_civil/_utils.py,sha256=eymiqO8KaTKdhVY3saebqNS0BbUUmGmgw3-ELKqew0A,2611
|
|
16
|
-
midas_civil-0.0.9.dist-info/licenses/LICENSE,sha256=zrL4RwZC4rb-by_ZHKXwKdIwcs6ATy59TPZ9HxPHCrs,1071
|
|
17
|
-
midas_civil-0.0.9.dist-info/METADATA,sha256=y9l-ZJ9DBHDFEvqV2qgdPjKgQk2TDDGQeL0v0EkobyQ,1709
|
|
18
|
-
midas_civil-0.0.9.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
19
|
-
midas_civil-0.0.9.dist-info/top_level.txt,sha256=_NFmrlN5V9OxJ-PAO4s_om8OA8uupXho3QqZcSsnbuI,12
|
|
20
|
-
midas_civil-0.0.9.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|