Hi, there
my code is below
resultlines=[targetlines[0] % dResult['SEC'],
targetlines[1] % line1b,
targetlines[2] % (section_type,dResult['SEC'],mat_data),
targetlines[3] % section_data,
targetlines[4] % (math.sin(float(dResult['ANG'])*math.pi/180),
math.cos(float(dResult['ANG'])*math.pi/180),
0)]
for line9 in resultlines:
line9=line9+"\n"
binf.write(line9)
, which generated the format with empty lines below
*beam section,section=I,elset=UC356X368X202,material=STEEL
0.1873,.3746,.3747,.3747,.027,.027,.0165
1.000000, 0.000000, 0.000000
*element,type=b31,elset=LCHS965-14-3
39,3490,1612
*beam section,section=PIPE,elset=LCHS965-14-3,material=S355
0.4825,.0143
0.000000, 1.000000, 0.000000
*element,type=b31,elset=LCHS965-14-3
40,3492,253
*beam section,section=PIPE,elset=LCHS965-14-3,material=S355
0.4825,.0143
0.000000, 1.000000, 0.000000
*element,type=b31,elset=LCHS965-14-3
41,259,3537
In order to delete these empty lines, I added code below
for line9 in resultlines:
if line9.isspace():
pass
else:
line9=line9+"\n"
binf.write(line9)
Unfortunately I got the same format. My code does not work. Could you reminder me of something? Thank you so much.
regards
ning