midas-civil 1.1.0__py3-none-any.whl → 1.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.

@@ -1,6 +1,6 @@
1
1
  from ._offsetSS import Offset
2
2
  from ._offsetSS import _common
3
- import math
3
+ from math import hypot
4
4
 
5
5
 
6
6
 
@@ -115,38 +115,345 @@ class _SS_PSC_12CELL(_common):
115
115
  vD[0],vD[1],vD[2],vD[3],vD[4],vD[5],vD[6],vD[7],
116
116
  offset,uShear,u7DOF,id)
117
117
 
118
- def _centerLine(shape,end):
118
+ def _centerLine(shape,*args):
119
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
120
+ HO1,HO2,HO21,HO22,HO3,HO31 = shape.HO1,shape.HO2,shape.HO21,shape.HO22,shape.HO3,shape.HO31
121
+ BO1,BO11,BO12,BO2,BO21,BO3 = shape.BO1,shape.BO11,shape.BO12,shape.BO2,shape.BO21,shape.BO3
129
122
 
130
- sect_lin_con = [[1,2],[2,3],[3,4],[2,5],[3,6],[5,6]]
123
+ HI1,HI2,HI21,HI22,HI3,HI31,HI4,HI41,HI42,HI5 = shape.HI1,shape.HI2,shape.HI21,shape.HI22,shape.HI3,shape.HI31,shape.HI4,shape.HI41,shape.HI42,shape.HI5
124
+ BI1,BI11,BI12,BI21,BI3,BI31,BI32,BI4 = shape.BI1,shape.BI11,shape.BI12,shape.BI21,shape.BI3,shape.BI31,shape.BI32,shape.BI4
131
125
 
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]
126
+ JO1,JO2,JO3,JI1,JI2,JI3,JI4,JI5 = shape.JO1,shape.JO2,shape.JO3,shape.JI1,shape.JI2,shape.JI3,shape.JI4,shape.JI5
135
127
 
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]
128
+ sect_cg_LT = [-(BO1+BO2+BO3),0]
129
+ sect_cg_RB = [(BO1+BO2+BO3),-(HO1+HO2+HO3)]
130
+ sect_cg_CC = [0,-(HO1+HO2+HO3)/2]
139
131
 
140
132
 
141
133
 
142
- sect_cg = (sect_cg_LT,sect_cg_CC,sect_cg_RB)
143
134
 
144
- return sect_shape, sect_thk ,sect_thk_off, sect_cg , sect_lin_con
135
+ def perpendicular_point(pt1,pt2,point, l=0):
136
+ """Function to get orthogonal point on line (x1,y1)-(x2,y2) from point (x3,y3). Enter l=0 for point 3 in between 1 & 2. Enter l=1 for other scenario."""
137
+ x1,y1 = pt1
138
+ x2,y2 = pt2
139
+ x3,y3 = point
145
140
 
146
-
141
+ if x2 != x1:
142
+ m = (y2 - y1) / (x2 - x1)
143
+ c = y1 - m * x1
144
+ x_perp = (x3 + m * (y3 - c)) / (1 + m**2)
145
+ y_perp = m * x_perp + c
146
+ else:
147
+ x_perp, y_perp = x1, y3
148
+
149
+ thk = ((x3 - x_perp)**2 + (y3 - y_perp)**2)**0.5
150
+ return (x_perp, y_perp),thk
151
+
152
+ def distance_point(pt1,pt2):
153
+ x1,y1 = pt1
154
+ x2,y2 = pt2
155
+
156
+ return hypot((x1-x2),(y1-y2))
157
+
158
+
159
+ HTI = HI1+HI2+HI3+HI4+HI5
160
+ HTO = HO1+HO2+HO3
161
+ slope = (HTI-HTO)/(BO1+BO2+BO3)
162
+
163
+
164
+ pt1 = (0,0)
165
+ pt2 = (0,-HI1)
166
+ pt5 = (-BI1,-HI1-HI2)
167
+ pt7 = (-BI3,-HI1-HI2-HI3)
168
+ pt10 = (0,-HI1-HI2-HI3-HI4)
169
+ pt11 = (0,-HTI)
170
+
171
+ pt12 = (-BO3,-HTI)
172
+ pt14 = (-BO3-BO2,(-HTI+HTO)-HO1-HO2)
173
+ pt17 = (-BO3-BO2-BO1,(-HTI+HTO)-HO1)
174
+ pt18 = (-BO3-BO2-BO1,(-HTI+HTO))
175
+
176
+ pt3 = (-BI11,-HI1-HI21)
177
+ pt4 = (-BI12,-HI1-HI22)
178
+
179
+ pt6 = (-BI21,-HI1-HI2-HI31)
180
+
181
+ pt8 = (-BI32,-HI1-HI2-HI3-HI4+HI42)
182
+ pt9 = (-BI31,-HI1-HI2-HI3-HI4+HI41)
183
+
184
+ pt13 = (-BO3-BO21,-HO1-HO2-HO3+HO31)
185
+
186
+ pt15 = (-BO3-BO2-BO1+BO12,(-HTI+HTO)-HO1-HO22)
187
+ pt16 = (-BO3-BO2-BO1+BO11,(-HTI+HTO)-HO1-HO21)
188
+
189
+
190
+ pt016 = (-BO3-BO2-BO1+BO11,slope*(-BO3-BO2-BO1+BO11))
191
+ pt015 = (-BO3-BO2-BO1+BO12,slope*(-BO3-BO2-BO1+BO12))
192
+ pt014 = (-BO3-BO2,slope*(-BO3-BO2))
193
+ pt05 = (-BI1,slope*(-BI1))
194
+ pt04 = (-BI12,slope*(-BI12))
195
+ pt03 = (-BI11,slope*(-BI11))
196
+ # ---------------------- OUTER POINTS ---------------------------
197
+
198
+ temppt = [pt016,pt015,pt014,pt05,pt04,pt03]
199
+ points = []
147
200
 
201
+ #-------
202
+ points.append(pt1)
203
+ points.append(pt2)
204
+ if JI1 : points.append(pt3)
205
+ if JI2 : points.append(pt4)
206
+ points.append(pt5)
207
+ if JI3 : points.append(pt6)
208
+ points.append(pt7)
209
+ if JI4 : points.append(pt8)
210
+ if JI5 : points.append(pt9)
211
+ points.append(pt10)
212
+ points.append(pt11)
213
+ points.append(pt12)
214
+ if JO3 : points.append(pt13)
215
+ points.append(pt14)
216
+ if JO2 : points.append(pt15)
217
+ if JO1 : points.append(pt16)
218
+ points.append(pt17)
219
+ points.append(pt18)
220
+ points.append(pt1)
221
+
222
+ x_values, y_values = zip(*points)
223
+
224
+ # ------------------- CENTER LINE POINTS ------------------
225
+
226
+ cp1 = (0,-HI1/2)
227
+
228
+
229
+ # cp2 = (-BI11,(-HI1-HI21)/2) #JI1
230
+ cp2 = np.add(pt3,pt03)/2
148
231
 
232
+ # cp3 = (-BI12,(-HI1-HI22)/2) #JI2
233
+ cp3 = np.add(pt4,pt04)/2
234
+ # cp4 = (-BI1,(-HI1-HI2)/2)
235
+ cp4 = np.add(pt5,pt05)/2
149
236
 
237
+ # cp5 = (-BO3-BO2-BO1,-HO1/2)
238
+ cp5 = np.add(pt17,pt18)/2
239
+ # cp6 = (-BO3-BO2-BO1+BO11,(-HO1-HO21)/2) #JO1
240
+ cp6 = np.add(pt16,pt016)/2
241
+ # cp7 = (-BO3-BO2-BO1+BO12,(-HO1-HO22)/2) #JO2
242
+ cp7 = np.add(pt15,pt015)/2
243
+ # cp8 = (-BO3-BO2,(-HO1-HO2)/2)
244
+ cp8 = np.add(pt14,pt014)/2
245
+
246
+ cp9 = np.add(cp8,cp4)/2
247
+
248
+ cp10 = np.add(pt5,pt14)/2
249
+
250
+ cp17 = np.add(pt10,pt11)/2
251
+ cp16 = (-BI31,(-HI1-HI2-HI3-HI4+HI41-HTI)/2) #JI5
252
+ cp15 = (-BI32,(-HI1-HI2-HI3-HI4+HI42-HTI)/2) #JI4
253
+ cp14 = (-BI3,(-HI1-HI2-HI3-HTI)/2)
254
+ cp13 = np.add(pt7,pt12)/2
255
+
256
+
257
+ tpt,TJI3 = perpendicular_point(pt13,pt14,pt6)
258
+ cp11 = np.add(tpt,pt6)/2 #JI3
259
+
260
+
261
+ tpt,TJO3 = perpendicular_point(pt7,pt6,pt13)
262
+ cp12 = np.add(tpt,pt13)/2 #JO3
263
+
264
+ # if cp12[1] < cp13[1] :
265
+ # print("JO3 invalid")
266
+
267
+
268
+ #----------------------------- THICKNESS COMPUTATION --------------
269
+
270
+ THI1 = HI1
271
+ TJI1 = distance_point(pt3,pt03)
272
+ TJI2 = distance_point(pt4,pt04)
273
+ THI2 = distance_point(pt5,pt05)
274
+ THO2 = distance_point(pt14,pt014)
275
+ THO1 = distance_point(pt17,pt18)
276
+ THI3 = (HI4+HI5)
277
+ THI5 = HI5
278
+ TJO1 = distance_point(pt16,pt016)
279
+ TJO2 = distance_point(pt15,pt015)
280
+ TJI4 = (HI5+HI42)
281
+ TJI5 = (HI5+HI41)
282
+
283
+
284
+ TX_INT_FLANGE = (HO1+HO2+HI1+HI2)/2
285
+ tpt,THIO2 = perpendicular_point(pt13,pt14,pt5)
286
+ TY_INT_FLANGE = THIO2
287
+
288
+ TX_BOT_JUNC = hypot(*np.subtract(pt7,pt12))
289
+
290
+ tpt,TY_BOT_JUNC = perpendicular_point(pt13,pt14,pt7)
291
+ # TY_BOT_JUNC = (TY_BOT_JUNC+hypot(*np.subtract(pt7,pt12)))/2
292
+
293
+
294
+
295
+ top_flange_point =[]
296
+ top_flange_line = []
297
+ top_flange_thk = []
298
+ q=1
299
+ top_flange_point.append(cp1)
300
+ if JI1 :
301
+ top_flange_point.append(cp2)
302
+ top_flange_line.append([q,q+1])
303
+ top_flange_thk.append([THI1,TJI1])
304
+ q+=1
305
+ if JI2 :
306
+ top_flange_point.append(cp3)
307
+ top_flange_line.append([q,q+1])
308
+ q+=1
309
+ if JI1:
310
+ top_flange_thk.append([TJI1,TJI2])
311
+ else :
312
+ top_flange_thk.append([THI1,TJI2])
313
+ top_flange_point.append(cp4)
314
+ top_flange_line.append([q,q+1])
315
+ q+=1
316
+
317
+ if JI2:
318
+ top_flange_thk.append([TJI2,THI2])
319
+ elif JI1:
320
+ top_flange_thk.append([TJI1,THI2])
321
+ else :
322
+ top_flange_thk.append([THI1,THI2])
323
+
324
+
325
+ top_flange_line.append([q,q+1]) # TO CONNECT WITH WEB
326
+ q+=1
327
+ top_flange_thk.append([THI2,TX_INT_FLANGE])
328
+
329
+
330
+
331
+ web_point =[]
332
+ web_line =[]
333
+ web_thk = []
334
+
335
+ web_point.append(cp9)
336
+ web_point.append(cp10)
337
+ web_line.append([q,q+1])
338
+ q+=1
339
+ web_thk.append([TY_INT_FLANGE,THIO2])
340
+ if JI3 :
341
+ web_point.append(cp11)
342
+ web_line.append([q,q+1])
343
+ q+=1
344
+ web_thk.append([THIO2,TJI3])
345
+ if JO3 and cp12[1] < cp13[1]:
346
+ web_point.append(cp12)
347
+ web_line.append([q,q+1])
348
+ if JI3 :
349
+ web_thk.append([TJI3,TJO3])
350
+ else:
351
+ web_thk.append([THIO2,TJO3])
352
+ q+=1
353
+
354
+ web_point.append(cp13)
355
+ web_line.append([q,q+1])
356
+ if JO3:
357
+ web_thk.append([TJO3,TY_BOT_JUNC])
358
+ elif JI3:
359
+ web_thk.append([TJI3,TY_BOT_JUNC])
360
+ else:
361
+ web_thk.append([THO2,TY_BOT_JUNC])
362
+ q+=1
363
+
364
+
365
+
366
+ bottom_flange_point =[]
367
+ bottom_flange_line =[]
368
+ bottom_flange_thk = []
369
+
370
+ bottom_flange_line.append([q,q+1]) # TO CONNECT WITH WEB
371
+ bottom_flange_thk.append([TX_BOT_JUNC,THI3])
372
+ q+=1
373
+ bottom_flange_point.append(cp14)
374
+ if JI4 :
375
+ bottom_flange_point.append(cp15)
376
+ bottom_flange_line.append([q,q+1])
377
+ q+=1
378
+ bottom_flange_thk.append([THI3,TJI4])
379
+ if JI5 :
380
+ bottom_flange_point.append(cp16)
381
+ bottom_flange_line.append([q,q+1])
382
+ q+=1
383
+ if JI4:
384
+ bottom_flange_thk.append([TJI4,TJI5])
385
+ else:
386
+ bottom_flange_thk.append([THI3,TJI5])
387
+ bottom_flange_point.append(cp17)
388
+ bottom_flange_line.append([q,q+1])
389
+ if JI5:
390
+ bottom_flange_thk.append([TJI5,THI5])
391
+ elif JI4:
392
+ bottom_flange_thk.append([TJI4,THI5])
393
+ else:
394
+ bottom_flange_thk.append([THI3,THI5])
395
+ q+=1
396
+
397
+
398
+ top_cantelever_point =[]
399
+ top_cantelever_line =[]
400
+ top_cantelever_thk =[]
401
+
402
+ top_cantelever_line.append([len(top_flange_point)+1,q+1]) # TO CONNECT WITH WEB
403
+ top_cantelever_thk.append([TX_INT_FLANGE,THO2])
404
+ q+=1
405
+ top_cantelever_point.append(cp8)
406
+ if JO2 :
407
+ top_cantelever_point.append(cp7)
408
+ top_cantelever_line.append([q,q+1])
409
+ q+=1
410
+ top_cantelever_thk.append([THO2,TJO2])
411
+ if JO1 :
412
+ top_cantelever_point.append(cp6)
413
+ top_cantelever_line.append([q,q+1])
414
+ q+=1
415
+ if JO2:
416
+ top_cantelever_thk.append([TJO2,TJO1])
417
+ else:
418
+ top_cantelever_thk.append([THO2,TJO1])
419
+ top_cantelever_point.append(cp5)
420
+ top_cantelever_line.append([q,q+1])
421
+ if JO1:
422
+ top_cantelever_thk.append([TJO1,THO1])
423
+ elif JO2:
424
+ top_cantelever_thk.append([TJO2,THO1])
425
+ else:
426
+ top_cantelever_thk.append([THO2,THO1])
427
+
428
+
429
+ final_points = top_flange_point+web_point+bottom_flange_point+top_cantelever_point
430
+ final_line = top_flange_line+web_line+bottom_flange_line+top_cantelever_line
431
+ final_thk = top_flange_thk+web_thk+bottom_flange_thk+top_cantelever_thk
432
+
433
+ n_points = len(final_points)
434
+ sect_shape = final_points
435
+ for i in range(n_points):
436
+ sect_shape.append((-final_points[i][0],final_points[i][1]))
437
+
438
+
439
+ sect_lin_con = final_line
440
+ sect_thk = final_thk
441
+
442
+
443
+ for q in range(len(final_line)):
444
+ sect_thk.append([final_thk[q][1],final_thk[q][0]])
445
+ sect_lin_con.append([final_line[q][1]+n_points,final_line[q][0]+n_points])
446
+
447
+ sect_thk_off = [0 for _ in sect_thk]
448
+
449
+
450
+
451
+
452
+ sect_cg = (sect_cg_LT,sect_cg_CC,sect_cg_RB)
453
+
454
+ return sect_shape, sect_thk ,sect_thk_off, sect_cg , sect_lin_con
455
+
456
+
150
457
 
151
458
 
152
459
 
midas_civil/_utils.py CHANGED
@@ -28,6 +28,7 @@
28
28
  # return(b)
29
29
  #---------------------------------------------------------------------------------------------------------------
30
30
 
31
+ import numpy as np
31
32
 
32
33
  def sFlatten(list_of_list):
33
34
  # list_of_list = [list_of_list]
@@ -84,11 +85,13 @@ def zz_add_to_dict(dictionary, key, value):
84
85
 
85
86
 
86
87
  def _convItem2List(item):
87
- if isinstance(item,list):
88
+ if isinstance(item,(list,np.ndarray)):
88
89
  return item
89
90
  return [item]
90
91
 
91
92
  def _matchArray(A,B):
93
+ '''Matches B to length of A
94
+ Return B'''
92
95
  A = _convItem2List(A)
93
96
  B = _convItem2List(B)
94
97
  n = len(A)
midas_civil/_view.py CHANGED
@@ -1,11 +1,219 @@
1
1
  from ._mapi import *
2
2
  from ._model import *
3
3
 
4
+ class Display:
4
5
 
6
+ Hidden = False
7
+ '''Toggle Hidden mode ie. 3D section display or line'''
5
8
 
6
- class View:
9
+ class __ActiveMeta__(type):
10
+ @property
11
+ def mode(cls):
12
+ ''' Mode - > "All" , "Active" , "Identity" '''
13
+ return cls.__mode__
14
+
15
+ @mode.setter
16
+ def mode(cls, value):
17
+ cls.__mode__ = value
18
+ cls.__default__ = False
19
+
20
+ class Active(metaclass = __ActiveMeta__ ):
21
+ '''Sets Elements to be Active for View.Capture() or View.CaptureResults()
22
+
23
+ **Mode** - "All" , "Active" , "Identity"
24
+ **Node_List** - Node to be active when Mode is "Active"
25
+ **Elem_List** - Element to be active when Mode is "Active"
26
+ **Identity_Type** - "Group" , "Boundary Group" , "Load Group" , "Named Plane"
27
+ **Identity_List** - String list of all the idenity items
28
+ '''
29
+ __mode__ = "All"
30
+ __default__ = True
31
+ node_list = []
32
+ elem_list = []
33
+ ident_type = "Group"
34
+ ident_list = []
35
+
36
+
37
+
38
+ @classmethod
39
+ def _json(cls):
40
+ if cls.__default__: json_body = {}
41
+ else:
42
+ json_body = {
43
+ "ACTIVE_MODE": cls.__mode__
44
+ }
45
+
46
+ if cls.mode == "Active" :
47
+ json_body["N_LIST"] = cls.node_list
48
+ json_body["E_LIST"] = cls.elem_list
49
+ elif cls.mode == "Identity" :
50
+ json_body["IDENTITY_TYPE"] = cls.ident_type
51
+ json_body["IDENTITY_LIST"] = cls.ident_list
52
+
53
+ return json_body
54
+
55
+
56
+ class __AngleMeta__(type):
57
+ @property
58
+ def Horizontal(cls):
59
+ return cls.__horizontal__
60
+
61
+ @Horizontal.setter
62
+ def Horizontal(cls, value):
63
+ cls.__horizontal__ = value
64
+ cls.__newH__ = True
65
+
66
+ @property
67
+ def Vertical(cls):
68
+ return cls.__vertical__
69
+
70
+ @Vertical.setter
71
+ def Vertical(cls, value):
72
+ cls.__vertical__ = value
73
+ cls.__newV__ = True
74
+
75
+ class Angle(metaclass = __AngleMeta__) :
76
+ __horizontal__ = 30
77
+ __vertical__ = 15
78
+ __newH__ = False
79
+ __newV__ = False
80
+
81
+ @classmethod
82
+ def _json(cls):
83
+
84
+ json_body = {}
85
+ if cls.__newH__ : json_body["HORIZONTAL"] = cls.__horizontal__
86
+ if cls.__newV__ : json_body["VERTICAL"] = cls.__vertical__
87
+
88
+ return json_body
89
+
90
+
91
+
92
+ class ResultGraphic:
93
+
94
+ class Contour:
95
+ use = True
96
+ num_color = 12
97
+ color = "rgb"
98
+
99
+ @classmethod
100
+ def _json(cls):
101
+ json_body = {
102
+ "OPT_CHECK": cls.use,
103
+ "NUM_OF_COLOR": cls.num_color,
104
+ "COLOR_TYPE": cls.color
105
+ }
106
+ return json_body
107
+
108
+ class Legend:
109
+ use = True
110
+ position = "right"
111
+ bExponent = False
112
+ num_decimal = 2
7
113
 
8
- def Capture(location="D:\\API_temp\\img3.jpg",img_w = 1280 , img_h = 720,view='',stage:str=''):
114
+ @classmethod
115
+ def _json(cls):
116
+ json_body = {
117
+ "OPT_CHECK":cls.use,
118
+ "POSITION": cls.position,
119
+ "VALUE_EXP":cls.bExponent,
120
+ "DECIMAL_PT": cls.num_decimal
121
+ }
122
+ return json_body
123
+
124
+ class Values:
125
+ use = False
126
+ bExpo = False
127
+ num_decimal = 2
128
+ orient_angle = 0
129
+
130
+ @classmethod
131
+ def _json(cls):
132
+ json_body = {
133
+ "OPT_CHECK":cls.use,
134
+ "VALUE_EXP": cls.bExpo,
135
+ "DECIMAL_PT":cls.num_decimal,
136
+ "SET_ORIENT": cls.orient_angle,
137
+ }
138
+ return json_body
139
+
140
+ class Deform:
141
+ use = False
142
+ scale = 1.0
143
+ bRealDeform = False
144
+ bRealDisp = False
145
+ bRelativeDisp = False
146
+
147
+ @classmethod
148
+ def _json(cls):
149
+ json_body = {
150
+ "OPT_CHECK":cls.use,
151
+ "SCALE_FACTOR": cls.scale,
152
+ "REL_DISP":cls.bRelativeDisp,
153
+ "REAL_DISP": cls.bRealDisp,
154
+ "REAL_DEFORM": cls.bRealDeform
155
+ }
156
+ return json_body
157
+
158
+ @staticmethod
159
+ def BeamDiagram(lcase_type,lcase_name,lcase_minmax="max",part='total',component='My') -> dict:
160
+
161
+ json_body = {
162
+ "CURRENT_MODE":"BeamDiagrams",
163
+ "LOAD_CASE_COMB":{
164
+ "TYPE":lcase_type,
165
+ "NAME":lcase_name,
166
+ "MINMAX" : lcase_minmax
167
+ },
168
+ "COMPONENTS":{
169
+ "PART":part,
170
+ "COMP":component
171
+ },
172
+ "DISPLAY_OPTIONS":{
173
+ "FIDELITY":"5 Points",
174
+ "FILL":"Line",
175
+ "SCALE":1.0
176
+ },
177
+ "TYPE_OF_DISPLAY":{
178
+ "CONTOUR": ResultGraphic.Contour._json(),
179
+ "DEFORM":ResultGraphic.Deform._json(),
180
+ "LEGEND":ResultGraphic.Legend._json(),
181
+ "VALUES":{
182
+ "OPT_CHECK":False
183
+ }
184
+ }
185
+ }
186
+ return json_body
187
+
188
+ @staticmethod
189
+ def DisplacementContour(lcase_type,lcase_name,lcase_minmax="max",component='DXYZ') -> dict:
190
+
191
+ json_body = {
192
+ "CURRENT_MODE":"DisplacementContour",
193
+ "LOAD_CASE_COMB":{
194
+ "TYPE":lcase_type,
195
+ "NAME":lcase_name,
196
+ "MINMAX" : lcase_minmax
197
+ },
198
+ "COMPONENTS":{
199
+ "COMP":component,
200
+ "OPT_LOCAL_CHECK" : False
201
+ },
202
+ "TYPE_OF_DISPLAY":{
203
+ "CONTOUR": ResultGraphic.Contour._json(),
204
+ "DEFORM":ResultGraphic.Deform._json(),
205
+ "LEGEND":ResultGraphic.Legend._json(),
206
+ "VALUES":{
207
+ "OPT_CHECK":False
208
+ }
209
+ }
210
+ }
211
+
212
+ return json_body
213
+
214
+ class View:
215
+ @staticmethod
216
+ def Capture(location="D:\\API_temp\\img3.jpg",img_w = 1280 , img_h = 720,view='pre',stage:str=''):
9
217
  ''' Location - image location
10
218
  Image height and width
11
219
  View - 'pre' or 'post'
@@ -13,10 +221,13 @@ class View:
13
221
  '''
14
222
  json_body = {
15
223
  "Argument": {
224
+ "SET_MODE":"pre",
225
+ "SET_HIDDEN":Display.Hidden,
16
226
  "EXPORT_PATH": location,
17
227
  "HEIGHT": img_h,
18
228
  "WIDTH": img_w,
19
- "ZOOM_LEVEL" : 100
229
+ "ACTIVE" : Display.Active._json(),
230
+ "ANGLE":Display.Angle._json()
20
231
  }
21
232
  }
22
233
 
@@ -28,4 +239,28 @@ class View:
28
239
  if stage != '':
29
240
  json_body['Argument']['STAGE_NAME'] = stage
30
241
 
31
- MidasAPI('POST','/view/CAPTURE',json_body)
242
+ MidasAPI('POST','/view/CAPTURE',json_body)
243
+
244
+ @staticmethod
245
+ def CaptureResults(ResultGraphic:dict,location:str="D:\\API_temp\\img3.jpg",img_w:int = 1280 , img_h:int = 720,CS_StageName:str=''):
246
+ '''
247
+ Result Graphic - ResultGraphic JSON (ResultGraphic.BeamDiagram())
248
+ Location - image location
249
+ Image height and width
250
+ Construction stage Name (default = "") if desired
251
+ '''
252
+ json_body = {
253
+ "Argument":{
254
+ "SET_MODE":"post",
255
+ "SET_HIDDEN":Display.Hidden,
256
+ "EXPORT_PATH":location,
257
+ "HEIGHT":img_h,
258
+ "WIDTH":img_w,
259
+ "ACTIVE":Display.Active._json(),
260
+ "ANGLE":Display.Angle._json(),
261
+ "RESULT_GRAPHIC": ResultGraphic
262
+ }
263
+ }
264
+ if CS_StageName != '':
265
+ json_body['Argument']['STAGE_NAME'] = CS_StageName
266
+ MidasAPI('POST','/view/CAPTURE',json_body)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: midas_civil
3
- Version: 1.1.0
3
+ Version: 1.1.1
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