Kwadratowe profile zamknięte gięte
Square hollow formed profiles

Działanie skryptu:
-
Zawiera definicje danych dla różnych kombinacji zmiennych profili
-
Wyświetla monit o wybranie procesu formowania (na gorąco lub na zimno)
-
Wyświetla monity o wybranie różnych wartości, z których każda zależy od wartości wybranych wcześniej
-
Pozwala to zapewnić poprawność danych
-
Tworzy nową część profilu giętego na podstawie wybranych wartości
*Podczas działania skryptu w oknie „Konsola” (Console) będą wyświetlane monity o wprowadzenie danych. Po wyświetleniu monitu wprowadź żądane parametry i naciśnij klawisz Enter na klawiaturze.
# Square hollow hot and cold formed profiles according to BS/EN-10210-2:1997 and BS/EN-10219:1997
# Measurements table B,T,ro,ri from here http://www.roymech.co.uk/Useful_Tables/Sections/SHS_hf.htmlPData = 0
HData = {}HData[20]=[2,3,2],[2.5,3.75,2.5]HData[25]=[2.0, 3.0, 2.0],[2.5, 3.75, 2.5],[3.0, 4.5, 3.0]HData[30]=[2.0, 3.0, 2.0],[2.5, 3.75, 2.5],[3.0, 4.5, 3.0]HData[40]=[2.5, 3.75, 2.5],[3.0, 4.5, 3.0],[3.2, 4.8, 3.2],[3.6, 5.4, 3.6],[4.0, 6.0, 4.0],[5.0, 7.5, 5.0]HData[50]=[2.5, 3.75, 2.5],[3.0, 4.5, 3.0],[3.2, 4.8, 3.2],[3.6, 5.4, 3.6],[4.0, 6.0, 4.0],[5.0, 7.5, 5.0],[6.0, 9.0, 6.0],[6.3, 9.45, 6.3]HData[60]=[2.5, 3.75, 2.5],[3.0, 4.5, 3.0],[3.2, 4.8, 3.2],[3.6, 5.4, 3.6],[4.0, 6.0, 4.0],[5.0, 7.5, 5.0],[6.0, 9.0, 6.0],[6.3, 9.45, 6.3],[8.0, 12.0, 8.0]HData[70]=[3.0, 4.5, 3.0],[3.2, 4.8, 3.2],[3.6, 5.4, 3.6],[4.0, 6.0, 4.0],[5.0, 7.5, 5.0],[6.0, 9.0, 6.0],[6.3, 9.45, 6.3],[8.0, 12.0, 8.0]HData[80]=[3.0, 4.5, 3.0],[3.2, 4.8, 3.2],[3.6, 5.4, 3.6],[4.0, 6.0, 4.0],[5.0, 7.5, 5.0],[6.0, 9.0, 6.0],[6.3, 9.45, 6.3],[8.0, 12.0, 8.0]HData[90]=[3.6, 5.4, 3.6],[4.0, 6.0, 4.0],[5.0, 7.5, 5.0],[6.0, 9.0, 6.0],[6.3, 9.45, 6.3],[8.0, 12.0, 8.0]HData[100]=[3.6, 5.4, 3.6],[4.0, 6.0, 4.0],[5.0, 7.5, 5.0],[6.0, 9.0, 6.0],[6.3, 9.45, 6.3],[8.0, 12.0, 8.0],[10.0, 15.0, 10.0]HData[120]=[4.0, 6.0, 4.0],[5.0, 7.5, 5.0],[6.0, 9.0, 6.0],[6.3, 9.45, 6.3],[8.0, 12.0, 8.0],[10.0, 15.0, 10.0],[12.0, 18.0, 12.0],[12.5, 18.75, 12.5]HData[140]=[5.0, 7.5, 5.0],[6.0, 9.0, 6.0],[6.3, 9.45, 6.3],[8.0, 12.0, 8.0],[10.0, 15.0, 10.0],[12.0, 18.0, 12.0],[12.5, 18.75, 12.5]HData[150]=[5.0, 7.5, 5.0],[6.0, 9.0, 6.0],[6.3, 9.45, 6.3],[8.0, 12.0, 8.0],[10.0, 15.0, 10.0],[12.0, 18.0, 12.0],[12.5, 18.75, 12.5],[16.0, 24.0, 16.0]HData[160]=[5.0, 7.5, 5.0],[6.0, 9.0, 6.0],[6.3, 9.45, 6.3],[8.0, 12.0, 8.0],[10.0, 15.0, 10.0],[12.0, 18.0, 12.0],[12.5, 18.75, 12.5],[16.0, 24.0, 16.0]HData[180]=[5.0, 7.5, 5.0],[6.0, 9.0, 6.0],[6.3, 9.45, 6.3],[8.0, 12.0, 8.0],[10.0, 15.0, 10.0],[12.0, 18.0, 12.0],[12.5, 18.75, 12.5],[16.0, 24.0, 16.0]HData[200]=[5.0, 7.5, 5.0],[6.0, 9.0, 6.0],[6.3, 9.45, 6.3],[8.0, 12.0, 8.0],[10.0, 15.0, 10.0],[12.0, 18.0, 12.0],[12.5, 18.75, 12.5],[16.0, 24.0, 16.0]HData[220]=[6.0, 9.0, 6.0],[6.3, 9.45, 6.3],[8.0, 12.0, 8.0],[10.0, 15.0, 10.0],[12.0, 18.0, 12.0],[12.5, 18.75, 12.5],[16.0, 24.0, 16.0]HData[250]=[5.0, 7.5, 5.0],[6.0, 9.0, 6.0],[6.3, 9.45, 6.3],[8.0, 12.0, 8.0],[10.0, 15.0, 10.0],[12.0, 18.0, 12.0],[12.5, 18.75, 12.5],[16.0, 24.0, 16.0]HData[260]=[6.0, 9.0, 6.0],[6.3, 9.45, 6.3],[8.0, 12.0, 8.0],[10.0, 15.0, 10.0],[12.0, 18.0, 12.0],[12.5, 18.75, 12.5],[16.0, 24.0, 16.0]HData[300]=[6.0, 9.0, 6.0],[6.3, 9.45, 6.3],[8.0, 12.0, 8.0],[10.0, 15.0, 10.0],[12.0, 18.0, 12.0],[12.5, 18.75, 12.5],[16.0, 24.0, 16.0]HData[350]=[8.0, 12.0, 8.0],[10.0, 15.0, 10.0],[12.0, 18.0, 12.0],[12.5, 18.75, 12.5],[16.0, 24.0, 16.0]HData[400]=[8.0, 12.0, 8.0],[10.0, 15.0, 10.0],[12.0, 18.0, 12.0],[12.5, 18.75, 12.5],[16.0, 24.0, 16.0],[20.0, 30.0, 20.0]
CData = {}CData[20]=[2.0, 4.0, 2.0],[2.5, 5.0, 2.5]CData[25]=[2.0, 4.0, 2.0],[2.5, 5.0, 2.5],[3.0, 6.0, 3.0]CData[30]=[2.0, 4.0, 2.0],[2.5, 5.0, 2.5],[3.0, 6.0, 3.0]CData[40]=[2.0, 4.0, 2.0],[2.5, 5.0, 2.5],[3.0, 6.0, 3.0],[4.0, 8.0, 4.0]CData[50]=[2.0, 4.0, 2.0],[2.5, 5.0, 2.5],[3.0, 6.0, 3.0],[4.0, 8.0, 4.0],[5.0, 10.0, 5.0]CData[60]=[2.0, 4.0, 2.0],[2.5, 5.0, 2.5],[3.0, 6.0, 3.0],[4.0, 8.0, 4.0],[5.0, 10.0, 5.0],[6.0, 12.0, 6.0],[6.3, 15.75, 9.45]CData[70]=[2.5, 5.0, 2.5],[3.0, 6.0, 3.0],[3.6, 7.2, 3.6],[4.0, 8.0, 4.0],[5.0, 10.0, 5.0],[6.0, 12.0, 6.0],[6.3, 15.75, 9.45]CData[80]=[3.0, 6.0, 3.0],[3.6, 7.2, 3.6],[4.0, 8.0, 4.0],[5.0, 10.0, 5.0],[6.0, 12.0, 6.0],[6.3, 15.75, 9.45],[8.0, 20.0, 12.0]CData[90]=[3.0, 6.0, 3.0],[3.6, 7.2, 3.6],[4.0, 8.0, 4.0],[5.0, 10.0, 5.0],[6.0, 12.0, 6.0],[6.3, 15.75, 9.45],[8.0, 20.0, 12.0]CData[100]=[3.0, 6.0, 3.0],[4.0, 8.0, 4.0],[5.0, 10.0, 5.0],[6.0, 12.0, 6.0],[6.3, 15.75, 9.45],[8.0, 20.0, 12.0],[10.0, 25.0, 15.0],[12.0, 36.0, 24.0],[12.5, 37.5, 25.0]CData[120]=[3.0, 6.0, 3.0],[4.0, 8.0, 4.0],[5.0, 10.0, 5.0],[6.0, 12.0, 6.0],[6.3, 15.75, 9.45],[8.0, 20.0, 12.0],[10.0, 25.0, 15.0],[12.0, 36.0, 24.0],[12.5, 37.5, 25.0]CData[140]=[4.0, 8.0, 4.0],[5.0, 10.0, 5.0],[6.0, 12.0, 6.0],[6.3, 15.75, 9.45],[8.0, 20.0, 12.0],[10.0, 25.0, 15.0],[12.0, 36.0, 24.0],[12.5, 37.5, 25.0]CData[150]=[4.0, 8.0, 4.0],[5.0, 10.0, 5.0],[6.0, 12.0, 6.0],[6.3, 15.75, 9.45],[8.0, 20.0, 12.0],[10.0, 25.0, 15.0],[12.0, 36.0, 24.0],[12.5, 37.5, 25.0],[16.0, 48.0, 32.0]CData[160]=[4.0, 8.0, 4.0],[5.0, 10.0, 5.0],[6.0, 12.0, 6.0],[6.3, 15.75, 9.45],[8.0, 20.0, 12.0],[10.0, 25.0, 15.0],[12.0, 36.0, 24.0],[12.5, 37.5, 25.0],[16.0, 48.0, 32.0]CData[180]=[4.0, 8.0, 4.0],[5.0, 10.0, 5.0],[6.0, 12.0, 6.0],[6.3, 15.75, 9.45],[8.0, 20.0, 12.0],[10.0, 25.0, 15.0],[12.0, 36.0, 24.0],[12.5, 37.5, 25.0],[16.0, 48.0, 32.0]CData[200]=[4.0, 8.0, 4.0],[5.0, 10.0, 5.0],[6.0, 12.0, 6.0],[6.3, 15.75, 9.45],[8.0, 20.0, 12.0],[10.0, 25.0, 15.0],[12.0, 36.0, 24.0],[12.5, 37.5, 25.0],[16.0, 48.0, 32.0]CData[220]=[5.0, 10.0, 5.0],[6.0, 12.0, 6.0],[6.3, 15.75, 9.45],[8.0, 20.0, 12.0],[10.0, 25.0, 15.0],[12.0, 36.0, 24.0],[12.5, 37.5, 25.0],[16.0, 48.0, 32.0]CData[250]=[5.0, 10.0, 5.0],[6.0, 12.0, 6.0],[6.3, 15.75, 9.45],[8.0, 20.0, 12.0],[10.0, 25.0, 15.0],[12.0, 36.0, 24.0],[12.5, 37.5, 25.0],[16.0, 48.0, 32.0]CData[260]=[6.0, 12.0, 6.0],[6.3, 15.75, 9.45],[8.0, 20.0, 12.0],[10.0, 25.0, 15.0],[12.0, 36.0, 24.0],[12.5, 37.5, 25.0],[16.0, 48.0, 32.0]CData[300]=[6.0, 12.0, 6.0],[6.3, 15.75, 9.45],[8.0, 20.0, 12.0],[10.0, 25.0, 15.0],[12.0, 36.0, 24.0],[12.5, 37.5, 25.0],[16.0, 48.0, 32.0]CData[350]=[8.0, 20.0, 12.0],[10.0, 25.0, 15.0],[12.0, 36.0, 24.0],[12.5, 37.5, 25.0],[16.0, 48.0, 32.0]CData[400]=[10.0, 25.0, 15.0],[12.0, 36.0, 24.0],[12.5, 37.5, 25.0],[16.0, 48.0, 32.0]
#--- INPUT HERE ---#print('Select hot or cold formed profiles')print('0 = Hot1 = Cold')HorC = int(Read())
if HorC == 0: PData = HDataelse: PData = CData
print('Input dimension in mm, only integers')print sorted(PData, key=lambda key: PData[key])Size = int(Read())
print('Please select thickness')for i,j in enumerate(PData[Size]): print i,'-',j[0],'mm'
readTh = int(Read())
Thick = PData[Size][readTh][0]ro = PData[Size][readTh][1]ri = PData[Size][readTh][2]
print('Please input length in mm')Length = float(Read())#--- INPUT STOP ---#
# all values are in millimetersUnits.Current = UnitTypes.Millimeters
# Create partSquare = Part('Hollow Section %dx%dx%d' % (Size,Thick,Length))
# BodyProfile = Square.AddSketch('Profile', Square.GetPlane('XY-Plane'))# Outer squareLine = Polyline()Line.AddPoint(PolylinePoint(-Size/2.,-Size/2))Line.AddPoint(PolylinePoint(Size/2.,-Size/2))Line.AddPoint(PolylinePoint(Size/2.,Size/2))Line.AddPoint(PolylinePoint(-Size/2.,Size/2))Line.AddPoint(PolylinePoint(-Size/2.,-Size/2))Profile.AddPolyline(Line,False)
# Inner SquarescaleFactor = ((Size-(Thick*2.))/Size)*100.0#print scaleFactorProfile.CopyFrom(Profile,0,0,0,0,0,0,0,scaleFactor)
# ExtrudeSquare.AddExtrudeBoss('Extrude',Profile,Length,False)
# Outer radiusSquare.AddFillet('Fillet<1>',[Square.GetEdge('Edge<6>'),Square.GetEdge('Edge<2>'),Square.GetEdge('Edge<4>'),Square.GetEdge('Edge<9>')],ro,False)
# Inner radiusSquare.AddFillet('Fillet<2>',[Square.GetEdge('Edge<30>'),Square.GetEdge('Edge<31>'),Square.GetEdge('Edge<33>'),Square.GetEdge('Edge<35>')],ri,False)Oryginał: Square hollow formed profiles