mybase = model.addSketch(mypart, model.defaultPlane("XOY"))
-l1 = mybase.addLine(0, 0, 0, 1)
-l2 = mybase.addLine(0, 1, 1, 1)
-l3 = mybase.addLine(1, 1, 1, 0)
-l4 = mybase.addLine(1, 0, 0, 0)
+l1 = mybase.addLine(0, 0, 0, 25)
+l2 = mybase.addLine(0, 25, 25, 25)
+l3 = mybase.addLine(25, 25, 25, 0)
+l4 = mybase.addLine(25, 0, 0, 0)
mybase.setCoincident(l1.endPoint(), l2.startPoint())
mybase.setCoincident(l2.endPoint(), l3.startPoint())
mywidth = mybase.setLength(l1, 50)
mylength = mybase.setDistance(l1.startPoint(), l3, 50)
+model.do()
# Creating the extrusion
myboss = model.addExtrusion(mypart, mystand.selectFace(), -5)
+model.do()
# Subtracting the cylinder to the box
mybase = model.addSketch(mypart, model.defaultPlane("XOY"))
p1 = geom.Pnt2d(0, 0)
-p2 = geom.Pnt2d(0, 1)
-p3 = geom.Pnt2d(1, 1)
-p4 = geom.Pnt2d(1, 0)
+p2 = geom.Pnt2d(0, 25)
+p3 = geom.Pnt2d(25, 25)
+p4 = geom.Pnt2d(25, 0)
line = model.addPolygon(mybase, p1, p2, p3, p4)
mywidth = mybase.setLength(line[0], 50)
mylength = mybase.setDistance(line[0].startPoint(), line[2], 50)
-
+model.do()
# Creating the extrusion
model.do()
myboss = model.addExtrusion(mypart, mystand.selectFace(), -5)
-
+model.do()
# Subtracting the cylinder to the box
line = model.addPolygon(self.base, p1, p2, p3, p4)
- self.base.setParallel(line[0], line[2])
- self.base.setParallel(line[1], line[3])
- self.base.setPerpendicular(line[0], line[3])
-
# Setting the size of the base with default values
# Width
self.width = self.base.setLength(line[0], 50) # Keeps the constraint for edition
# Length
self.length = self.base.setLength(line[3], 50) # Keeps the constraint for edition
+ # Keeping the rectangle
+ self.base.setParallel(line[0], line[2])
+ self.base.setParallel(line[1], line[3])
+ self.base.setPerpendicular(line[0], line[3])
+
+ # execute sketch
+ model.do()
+
# Creating the extrusion (the box) at default size
# A box result
self.box = model.addExtrusion(mypart, self.base.selectFace(), 50)