Browsed by
Tag: extrude

MidPlane Extrusion

MidPlane Extrusion

Compatible with WizoScript 3.00 and later.

Shows how to extrude from the mid-plane.

# create the part and then a sketch containing a circle
P = Part("Test")
S = P.AddSketch("Shape", P.GetPlane("XY-Plane"))
S.AddCircle(0, 0, 9, False)

# how far we will extrude from mid-plane
ExtrudeLength = 10

# extrude it
P.AddExtrudeBoss("Cyl", S, ExtrudeLength, False, Part.EndCondition.MidPlane, None, 0, Part.DirectionType.Normal, None, 0, False)
Getting User Input

Getting User Input

Compatible with WizoScript versions: 1.42

Shows how to request information from the user and then use that data to construct a part.

# Demonstrates requesting values from the user then creating a part
# with those values
 
print "Input width in mm and press Enter"
Width = float(Read())
if Width < 0.1:
  sys.exit("Width must be at least 0.1 mm")
 
print "Input height in mm and press Enter"
Height = float(Read())
if Height < 0.1:
  sys.exit("Height must be at least 0.1 mm")
   
print "Input depth in mm and press Enter"
Depth = float(Read())
if Depth < 0.1:
  sys.exit("Depth must be at least 0.1 mm")
 
print "Creating a box measuring %f mm x %f mm x %f mm..." % (Width, Height, Depth)
 
MyPart = Part("My Part")
Profile = MyPart.AddSketch("Profile", MyPart.GetPlane("XY-Plane"))
Profile.AddRectangle(0, 0, Width, Height, False)
MyPart.AddExtrudeBoss("Box", Profile, Depth, False)
Hex Head Bolt

Hex Head Bolt

Compatible with WizoScript version 1.22 and later.

Creates a simple bolt with a cap head featuring a hexagonal recess.

MyPart = Part("My Part")
 
XYPlane = MyPart.GetPlane("XY-Plane")
HeadSketch = MyPart.AddSketch("Head", XYPlane)
HeadSketch.AddCircle(0, 0, 10, False)
BoltHead = MyPart.AddExtrudeBoss("Bolt Head", HeadSketch, 5, False)
 
HeadBottomPlane = MyPart.AddPlane("Head Bottom", XYPlane, 5)
ShoulderSketch = MyPart.AddSketch("Shoulder", HeadBottomPlane)
ShoulderSketch.AddCircle(0, 0, 5, False)
BoltShoulder = MyPart.AddExtrudeBoss("Bolt Shoulder", ShoulderSketch, 20, False)
 
HexSketch = MyPart.AddSketch("Hex", XYPlane)
HexSketch.AddPolygon(0, 0, 5, 6, False)
HexRecess = MyPart.AddExtrudeCut("Hex Recess", HexSketch, 3, False)
 
MyPart.Save("C:\Users\Andy\Desktop")
MyPart.ExportSTL("C:\Users\Andy\Desktop\My Part.stl")
MyPart.Close()