Gist URL: https://gist.github.com/stephensmitchell/5ee69c3f4e697a3b23cf075a9aedcce0
- MaxCellSize.jpg
- NormalDeviation.jpg
- Part Exporter.py
- STL Exporter.py
Gist URL: https://gist.github.com/stephensmitchell/5ee69c3f4e697a3b23cf075a9aedcce0
| #https://help.alibre.com/articles/#!alibre-help-v28/working-with-configurations | |
| # create a new part | |
| P = Part('Test') | |
| # create a new configuration | |
| Foo = P.AddConfiguration('Foo') | |
| # it's already unlocked by default but this is how to unlock a configuration | |
| Foo.UnlockAll() | |
| # set a single lock |
| #https://help.alibre.com/articles/#!alibre-help-v28/wave-washer | |
| import math | |
| from math import * | |
| # radius | |
| R = 100.0 | |
| # amplitude | |
| A = 10.0 | |
| # number of waves (must be a whole number) |
| #https://help.alibre.com/articles/#!alibre-help-v28/useful-dialogs | |
| Win = Windows() | |
| Win.InfoDialog('I am about to create a part', 'My Script') | |
| Win.ErrorDialog("Oops. That didn't go as planned", 'My Script') | |
| # returns True for 'yes' and False for 'no' | |
| print Win.QuestionDialog('Shall I stop?', 'My Script') |
| #https://help.alibre.com/articles/#!alibre-help-v28/units | |
| # demonstrates using multiple units in a script | |
| # create a part and a sketch | |
| MyPart = Part('My Part') | |
| XYPlane = MyPart.GetPlane('XY-Plane') | |
| Sketch = MyPart.AddSketch('Sketch', XYPlane) | |
| # set units to mm - this is implied at the start of every script |
| #https://help.alibre.com/articles/#!alibre-help-v28/type-11-flanges-according-to-bs-en-1092-pn16 | |
| from math import cos,sin,radians | |
| # Size of Flange TYPE 11 According to BS/EN-1092 PN16 | |
| #--- INPUT HERE ---# | |
| print('Input DN Flange size: 10, 15, 20, 25, 32, 40, 50, 65, 80, 100, 125, 150, 200, 250, 300, 350, 400, 450, 500, 600, 700, 800, 900, 1000, 1200, 1400, 1600') | |
| DN = int(Read()) |
| #https://help.alibre.com/articles/#!alibre-help-v28/triangle | |
| # Create triangle with angles 90, 15, 75 | |
| import math | |
| # set up parameters | |
| Theta = 15.0 | |
| Adjacent = 100.0 | |
| #https://help.alibre.com/articles/#!alibre-help-v28/tool-cutting | |
| # cylinder dimensions | |
| Diameter = 20 | |
| Length = 100 | |
| # cutter dimensions | |
| CutterDiameter = 5 | |
| # angle to increase by on each pass of the cutter, in degrees |
| #https://help.alibre.com/articles/#!alibre-help-v28/supressing-unsupressing-and-removing-features | |
| # create a part | |
| P = Part('Example Part') | |
| # create a cube | |
| CubeSketch = P.AddSketch('CubeProfile', P.GetPlane('XY-Plane')) | |
| CubeSketch.AddRectangle(0, 0, 10, 10, False) | |
| CubeFeature = P.AddExtrudeBoss('Cube', CubeSketch, 10, True) | |
| #https://help.alibre.com/articles/#!alibre-help-v28/square-hollow-formed-profiles | |
| # 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.html | |
| PData = 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] |