What's new

TUTORIAL: Cylinder Between Two Points

ajayre

Alibre Super User
Open a part or create a new part and insert two design points where the start and ends of the cylinder need to go.



Copy and paste this script http://www.wizotools.com/2016/06/01/cylinder-between-two-points-ii/ into WizoScript and run it.

The following dialog window will be shown.



Select the two points and enter the diameter of the cylinder. Click on OK. The cylinder will be created.



Under the hood:

Creating the dialog only requires three input lines:

Code:
Options = []
Options.append(["Start Point", WindowsInputTypes.Point, None])
Options.append(["End Point", WindowsInputTypes.Point, None])
Options.append(["Diameter", WindowsInputTypes.Real, 5])

Values = Win.OptionsDialog("Cylinder", Options)

We request from the user two points and a value.

Getting the part is simple:

Code:
# get the part that defines the first point
# it is possible the second point is on a different part but we will assume
# they are on the same part
P = Values[0].GetPart()

Note that WizoScript allows selection from any part that might be open. So if you have three parts open at the same time the user could select items from multiple parts. This could be used to create scripts that transfer data between parts or compare parts.
 

Attachments

  • Cylinder-1.png
    Cylinder-1.png
    2.6 KB · Views: 280
  • Cylinder-3.png
    Cylinder-3.png
    17 KB · Views: 280
  • Cylinder-2.png
    Cylinder-2.png
    19.7 KB · Views: 279
Top