Example #1
0
import Drawing

# Create three boxes and a cylinder
App.ActiveDocument.addObject("Part::Box", "Box")
App.ActiveDocument.Box.Length = 100.00
App.ActiveDocument.Box.Width = 101.00
App.ActiveDocument.Box.Height = 102.00

App.ActiveDocument.addObject("Part::Box", "Box1")
App.ActiveDocument.Box1.Length = 90.00
App.ActiveDocument.Box1.Width = 40.00
App.ActiveDocument.Box1.Height = 100.00

cube1 = Part.makeBox(2, 2, 2)
cube1.Length = 2
Part.Show(cube1)

App.ActiveDocument.addObject("Part::Box", "Box2")
App.ActiveDocument.Box2.Length = 20.00
App.ActiveDocument.Box2.Width = 85.00
App.ActiveDocument.Box2.Height = 100.00

App.ActiveDocument.addObject("Part::Cylinder", "Cylinder")
App.ActiveDocument.Cylinder.Radius = 80.00
App.ActiveDocument.Cylinder.Height = 100.00
App.ActiveDocument.Cylinder.Angle = 360.00
# Fuse two boxes and the cylinder
App.ActiveDocument.addObject("Part::Fuse", "Fusion")
App.ActiveDocument.Fusion.Base = App.ActiveDocument.Cylinder
App.ActiveDocument.Fusion.Tool = App.ActiveDocument.Box1