Skip to content

Commit 629f155

Browse files
Update hall.py
1 parent 20fd218 commit 629f155

1 file changed

Lines changed: 26 additions & 23 deletions

File tree

Examples/Hall/hall.py

Lines changed: 26 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
d = float(input('Distance between frames in m: '))
2323
h = float(input('Height of frame in m: '))
2424

25-
Model()
25+
Model(True, 'hall')
2626
Model.clientModel.service.begin_modification()
2727

2828
# nodes
@@ -65,27 +65,29 @@
6565

6666
# vertical bracing
6767
# add a question about repeating in every block, one yes one no, only beginning and end
68-
68+
BracingV_C1, BracingV_C2, BracingV_C3 = '', '', ''
6969
BracingV = input('Would you like to include vertical bracing? (Y/N)')
7070
if BracingV.lower() == 'yes' or BracingV.lower() == 'y':
71+
72+
Material(3, 'EN AW-3004 H14')
73+
Section(3, 'IPE 80', 3)
74+
7175
BracingV_C1 = input(
7276
'Would you like to repeat a vertical bracing in every block? (Y/N)')
7377
if BracingV_C1.lower() == 'yes' or BracingV_C1.lower() == 'y':
74-
Material(3, 'EN AW-3004 H14')
75-
Section(3, 'IPE 80', 3)
78+
7679
j = 4*n + 3*(n-1)
7780
k = 4*n + 2*(n-1)
7881
for i in range(n):
7982
Member(k+1+4*i, i*5+1, i*5+7, 0.0, 3, 3)
8083
Member(k+2+4*i, i*5+2, i*5+6, 0.0, 3, 3)
8184
Member(k+3+4*i, i*5+5, i*5+9, 0.0, 3, 3)
8285
Member(k+4+4*i, i*5+4, i*5+10, 0.0, 3, 3)
86+
else:
87+
BracingV_C2 = input(
88+
'Would you like to repeat a vertical bracing only in the first and last block? (Y/N)')
8389

84-
BracingV_C2 = input(
85-
'Would you like to repeat a vertical bracing only in the first and last block? (Y/N)')
8690
if BracingV_C2.lower() == 'yes' or BracingV_C2.lower() == 'y':
87-
Material(3, 'EN AW-3004 H14')
88-
Section(3, 'IPE 80', 3)
8991

9092
k = n*4+(n-1)*2
9193
for i in range(n):
@@ -99,12 +101,12 @@
99101
Member.Tension(k+4+4*i, i*5+4, i*5+10,
100102
MemberRotationSpecificationType.COORDINATE_SYSTEM_ROTATION_VIA_ANGLE, [0], 3)
101103

102-
# MAKE IT MORE GENERAL!
103-
BracingV_C3 = input(
104-
'Would you like to repeat a vertical bracing in even/odd blocks? (Y/N)')
104+
elif BracingV_C2.lower() == 'no' or BracingV_C2.lower() == 'n':
105+
# MAKE IT MORE GENERAL!
106+
BracingV_C3 = input(
107+
'Would you like to repeat a vertical bracing in even/odd blocks? (Y/N)')
108+
105109
if BracingV_C3.lower() == 'yes' or BracingV_C3.lower() == 'y':
106-
Material(3, 'EN AW-3004 H14')
107-
Section(3, 'IPE 80', 3)
108110

109111
j = 4*n + 3*(n-1)
110112
k = 4*n + 2*(n-1)
@@ -124,17 +126,18 @@
124126

125127
member_count = n*4+(n-1)*2
126128
BracingH = input('Would you like to include horizontal bracing? (Y/N)')
127-
if BracingV.lower() == 'yes' or BracingV.lower() == 'y':
129+
if BracingH.lower() == 'yes' or BracingH.lower() == 'y':
130+
131+
Material(3, 'EN AW-3004 H14')
132+
Section(3, 'IPE 80', 3)
133+
128134
member_count += (n-1)*4
129-
BracingH = 'yes'
130-
if BracingH.lower() == 'yes' or BracingH.lower() == 'y':
131-
132-
for i in range(n-1):
133-
j = i * 5
134-
Member(int(member_count+1+4*i), j+2, j+8, 0.0, 3, 3)
135-
Member(int(member_count+2+4*i), j+3, j+7, 0.0, 3, 3)
136-
Member(int(member_count+3+4*i), j+3, j+9, 0.0, 3, 3)
137-
Member(int(member_count+4+4*i), j+4, j+8, 0.0, 3, 3)
135+
for i in range(n-1):
136+
j = i * 5
137+
Member(int(member_count+1+4*i), j+2, j+8, 0.0, 3, 3)
138+
Member(int(member_count+2+4*i), j+3, j+7, 0.0, 3, 3)
139+
Member(int(member_count+3+4*i), j+3, j+9, 0.0, 3, 3)
140+
Member(int(member_count+4+4*i), j+4, j+8, 0.0, 3, 3)
138141

139142
print("Preparing...")
140143
print('Ready!')

0 commit comments

Comments
 (0)