Created
September 8, 2012 17:12
-
-
Save edrex/3677323 to your computer and use it in GitHub Desktop.
FreeCAD Scripting Examples
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import FreeCAD | |
import Part | |
App.newDocument() | |
App.setActiveDocument("Unnamed") | |
App.ActiveDocument=App.getDocument("Unnamed") | |
Gui.ActiveDocument=Gui.getDocument("Unnamed") | |
box = App.ActiveDocument.addObject("Part::Box","Box") | |
box.Placement = App.Placement(App.Vector(1,1,1),App.Rotation(0,0,0,1)) | |
box.Height = 5.00 | |
box.Length = 5.00 | |
box.Width = 5.00 | |
sphere = App.ActiveDocument.addObject("Part::Sphere","Sphere") | |
sphere.Placement = App.Placement(App.Vector(5,5,5),App.Rotation(0,0,0,1)) | |
App.ActiveDocument.recompute() | |
Gui.SendMsgToActiveView("ViewFit") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment