Posts
 
Reputation
Joined
Last Seen
0 Reputation Points
Unknown Quality Score

No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.

~2K People Reached
Favorite Forums
Favorite Tags
Member Avatar for ning2009

Hi, there With a lot of help in this forum, I strated to use Python to accomplish something. Here I am looking for guide about how to improve my code speed. This code is to determine the normal direction of a polygon with four points. Every four points have 6 …

Member Avatar for ning2009
0
210
Member Avatar for ning2009

Hi, there I have been confused about format control of List. My problem is that I get strange format when exchanging List[-1] with List[-2] using a middle variable. My code is to handle a text file. Old code in a For loop is: [QUOTE]sinf.write('*element,type=s4r,elset=WSLAB\n') path4b2_value[0]=str(int(path4b2_value[0])+100000) path4b3=','.join(path4b2_value) sinf.write(path4b3)[/QUOTE] which produces a …

Member Avatar for ning2009
0
126
Member Avatar for ning2009

Hi, there I have resource lines and target lines here below resource lines: 1 J=2,7183 SEC=CON450X450 NSEG=2 ANG=0 56 J=7224,164 SEC=CON450X450 NSEG=2 ANG=0 Target lines: *element,type=b31,elset=CON450X4501 *element,type=b31,elset=CON450X45056 "elset=CON450X4501" in the target lines come from a combination of "1" and "SEC=CON450X450". Similarly, "elset=CON450X45056" in the target lines come from a combination …

Member Avatar for ning2009
0
167
Member Avatar for ning2009

Hi, there Thank you so much for reading my question. I have apart of a text file with a structure as following: LOAD NAME=LIVE TYPE=UNIFORM ADD=110 UZ=-4500 ADD=113 UZ=-4500 ADD=114 UZ=-4500 ADD=120 UZ=-4500 ADD=121 UZ=-4500 NAME=SIDL TYPE=UNIFORM ADD=110 UZ=-850 ADD=113 UZ=-850 NAME=CLADDING TYPE=DISTRIBUTED SPAN ADD=15470 RD=0,1 UZ=-4500,-4500 ADD=15471 RD=0,1 UZ=-4500,-4500 …

Member Avatar for ning2009
0
200
Member Avatar for ning2009

Hi, there my code is below [ICODE] 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)[/ICODE] , 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 …

Member Avatar for amitattri1987
0
409
Member Avatar for ning2009

Hi, there I have the code (from Jice) using List below [CODE=syntax] targetlines=["*beam section,section=%s, elset=%s, material=%s", "%s", "%f, %f, %f"] resultlines=[targetlines[0] % (dResult['SEC'],section_type,mat_data), targetlines[1] % section_data, targetlines[2] % (math.sin(float(dResult['ANG'])*math.pi/180), math.cos(float(dResult['ANG'])*math.pi/180), 0)][/CODE] , which worked well However when I modified it to [CODE=syntax] targetlines=["*element,type=b31, elset=%s", "%s", "*beam section,section=%s, elset=%s, material=%s", "%s", …

Member Avatar for ning2009
0
91
Member Avatar for ning2009

Hi, there Let me put my resource line and target lines here firstly resource line: 56 J=7224,164 SEC=CON450X450 ANG=45 target lines: *beam section,section=R, elset=CON450X45056,material=con2 0.45,0.45 0.707107,0.707107,0 I have a dictionary below (created using woooee's code) Frame_Section contains {'CON450X450': [['MAT', 'CONC2'], ['SH', 'R'], ['T', '.45,.45']], 'B400': [['MAT', 'CONC2'], ['SH', 'R'], ['T', …

Member Avatar for ning2009
0
209
Member Avatar for ning2009

Hi, Guys, I use RG to handle some txt files in Python to rearrange format of these text files. These text files look like below MATERIAL NAME=STEEL IDES=S W=76819.55 T=0 E=1.99948E+11 U=.3 A=.0000117 FY=3.447379E+08 NAME=CONC2 IDES=C W=23560 T=0 E=2.48211E+10 U=.2 A=.0000099 NAME=OTHER IDES=N W=76819.55 T=0 E=1.99948E+11 U=.3 A=.0000117 NAME=CON3 IDES=C …

Member Avatar for ning2009
0
331
Member Avatar for ning2009

Hi, there I have some lines in a text file as 159 J=1661,3169,1679,3181 SEC=SLAB2 66 J=5597,5596,7523,7522 SEC=WALL1 How can I delete "SEC=SLAB2" or "SEC=WALL1" and modify the roginal lines into new ones, if I have RE functions 159 J=1661,3169,1679,3181 66 J=5597,5596,7523,7522 I am using and stuyding Python. Please forget me …

Member Avatar for ning2009
0
107
Member Avatar for ning2009

Hi, there Asssuming that I have some lines below 28 J=5202,5204,7497,7498 SEC=WALL1 1185 J=289,3875,2673 SEC=SLAB2 I would like to count number of digital after "J=" on the above two lines in a text file. I am expecting results below the first line: 5202,5204,7497,7498 =====> Answer: 4 the second line: 289,3875,2673 …

Member Avatar for ning2009
0
102