Firstly, I have to tell you that I'm an absolute noob at python and started using it hoping to be able to create small executable files for basic engineering tasks. For example, the below code calculates the tracing coordinates for a progressive curve for railways:
l=int(input('l='))
r=int(input('r='))
for x in range(0,l+1,2):
y=round(((x**3)/(6*l*r)),4)
for x in range(0,l+1,2):
grafic=print(x,",",round(((x**3)/(6*l*r)),4),sep='')
with the output, for given variables values:
l=42
r=195
0,0.0
2,0.0002
4,0.0013
6,0.0044
8,0.0104
10,0.0204
12,0.0352
14,0.0558
16,0.0834
18,0.1187
20,0.1628
22,0.2167
24,0.2813
26,0.3577
28,0.4467
30,0.5495
32,0.6668
34,0.7998
36,0.9495
38,1.1166
40,1.3024
42,1.5077
I'm trying to create a ".scr" or ".txt" file from this result which must be:
pline
0,0.0
2,0.0002
4,0.0013
6,0.0044
8,0.0104
10,0.0204
12,0.0352
14,0.0558
16,0.0834
18,0.1187
20,0.1628
22,0.2167
24,0.2813
26,0.3577
28,0.4467
30,0.5495
32,0.6668
34,0.7998
36,0.9495
38,1.1166
40,1.3024
42,1.5077
The ideea is to creat a script file which can be imported in ACAD for example, the output beeing that it traces a 2D polyline. Any help would be greatly appreciated!