Kunstmaan
Alibre Super User
Some years ago I created a "Wizo" script to make a parbole and at that time it worked.
But now it doesnt, so I am puzled.
Can somebody what wrong in this code
But now it doesnt, so I am puzled.
Code:
Units.Current = UnitTypes.Millimeters
x_max = 600
y_max = 180
step = 25
f = 500
#formula x=y^2/4f
def para(x):
y = x**2 / (4*f)
print " x = %.3f , y = %.3f" % (x, y)
return(y)
#Create part
MyPart = Part("Parabola")
Parabola = MyPart.AddSketch("Parabola", MyPart.GetPlane("XY-Plane"))
#Generate list of points
points = []
for x in range(0, x_max+step, step):
points.extend([x, para(x)])
# Place it in a sketch
Parabola.AddBsplineThroughPoints(3, points, False)
Can somebody what wrong in this code