Skip to content

Instantly share code, notes, and snippets.

@Foadsf
Created April 13, 2017 13:40
Show Gist options
  • Save Foadsf/6e7055b2282e4643bef83b5a33b572b9 to your computer and use it in GitHub Desktop.
Save Foadsf/6e7055b2282e4643bef83b5a33b572b9 to your computer and use it in GitHub Desktop.
the FreeCAD python macro/script creates 3 boxes and then fuses two
test1 = App.newDocument("Test1")
cylinder=test1.addObject("Part::Box","Cylinder")
cylinder.Height = '20 mm'
cylinder.Width = '5 mm'
cylinder.Length = '40 mm'
myvec = App.Vector(5,0,5)
myvec_2 = App.Vector(0,0,0)
mybox=test1.addObject("Part::Box","Mybox")
mybox.Height = '5 mm'
mybox.Width = '15 mm'
mybox.Length = '10 mm'
mybox.Placement.Base = myvec
mybox_2=test1.addObject("Part::Box","Mybox_2")
mybox_2.Height = '5 mm'
mybox_2.Width = '10 mm'
mybox_2.Length = '20 mm'
mybox_2.Placement.Base = myvec_2
myfus = test1.addObject("Part::Fuse","myFus")
myfus.Base = mybox
myfus.Tool = mybox_2
mybox.Visibility=False
mybox_2.Visibility=False
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment