#1 Copy selected object into a new document, reset Placement, and select the copied object copies = 2 sel = FreeCADGui.Selection.getSelection() #defines sel as a list of selected objects sel = sel[0] #consider only the first element in the list of selected objects. name = sel.Name shape = sel.Shape label = sel.Label for i in range(1,copies): newdocument = FreeCAD.newDocument() #create new document newshape = sel.Shape.copy() #copy selected object newshape.Placement=App.Placement(App.Vector(0,0,0), App.Rotation(App.Vector(0,0,1),0), App.Vector(0,0,0)) #placement is reseted newobject = FreeCAD.ActiveDocument.addObject("Part::Feature",name) newobject.Shape = newshape objName = name obj = App.ActiveDocument.getObject(objName) obj.Label = label Gui.Selection.addSelection(obj) #Select the duplicated object Gui.SendMsgToActiveView("ViewFit") #2 Create 4 different iso views for selected object import FreeCAD, Part, Drawing, Draft def zero(): sel = FreeCADGui.Selection.getSelection() try: App.ActiveDocument.getObject(sel[0].Name).Placement=App.Placement(App.Vector(0,0,0), App.Rotation(App.Vector(0,0,1),0), App.Vector(0,0,0)) except Exception: App.Console.PrintError("Select one object" + "\n") zero() if len(Gui.Selection.getSelectionEx())>1: App.Console.PrintError("Warning: Only the first item is generate") if len(Gui.Selection.getSelectionEx())==0: App.Console.PrintError("Warning: Need to select one item") Piece=Gui.Selection.getSelectionEx()[0] App.activeDocument().addObject('Drawing::FeaturePage','AutoDrawing') App.activeDocument().AutoDrawing.Template = App.getResourceDir()+'Mod/Drawing/Templates/A0_Landscape_plain.svg' #Create IsotView1 App.activeDocument().addObject('Drawing::FeatureViewPart','IsoView1') App.activeDocument().IsoView1.Source =Piece.Object App.activeDocument().IsoView1.Direction = (1,-1,-1) App.activeDocument().IsoView1.Rotation=60 App.activeDocument().IsoView1.Scale = 2 App.activeDocument().IsoView1.LineWidth = 0.75 App.activeDocument().IsoView1.X = 400 App.activeDocument().IsoView1.Y = 300 App.activeDocument().IsoView1.ShowHiddenLines=False App.activeDocument().AutoDrawing.addObject(App.activeDocument().IsoView1) #Create IsotView2 App.activeDocument().addObject('Drawing::FeatureViewPart','IsoView2') App.activeDocument().IsoView2.Source =Piece.Object App.activeDocument().IsoView2.Direction = (1,1,1) App.activeDocument().IsoView2.Rotation=240 App.activeDocument().IsoView2.Scale = 2 App.activeDocument().IsoView2.LineWidth = 0.75 App.activeDocument().IsoView2.X = 500 App.activeDocument().IsoView2.Y = 400 App.activeDocument().IsoView2.ShowHiddenLines=False App.activeDocument().AutoDrawing.addObject(App.activeDocument().IsoView2) #Create IsotView3 App.activeDocument().addObject('Drawing::FeatureViewPart','IsoView3') App.activeDocument().IsoView3.Source =Piece.Object App.activeDocument().IsoView3.Direction = (1,-1,1) App.activeDocument().IsoView3.Rotation=60 App.activeDocument().IsoView3.Scale = 2 App.activeDocument().IsoView3.LineWidth = 0.75 App.activeDocument().IsoView3.X = 700 App.activeDocument().IsoView3.Y = 500 App.activeDocument().IsoView3.ShowHiddenLines=False App.activeDocument().AutoDrawing.addObject(App.activeDocument().IsoView3) #Create IsotView4 App.activeDocument().addObject('Drawing::FeatureViewPart','IsoView4') App.activeDocument().IsoView4.Source =Piece.Object App.activeDocument().IsoView4.Direction = (-1,-1,-1) App.activeDocument().IsoView4.Rotation=60 App.activeDocument().IsoView4.Scale = 2 App.activeDocument().IsoView4.LineWidth = 0.75 App.activeDocument().IsoView4.X = 800 App.activeDocument().IsoView4.Y = 600 App.activeDocument().IsoView4.ShowHiddenLines=False App.activeDocument().AutoDrawing.addObject(App.activeDocument().IsoView4) #Create IsotView5 App.activeDocument().addObject('Drawing::FeatureViewPart','IsoView5') App.activeDocument().IsoView5.Source =Piece.Object App.activeDocument().IsoView5.Direction = (-1,1,1) App.activeDocument().IsoView5.Rotation=240 App.activeDocument().IsoView5.Scale = 2 App.activeDocument().IsoView5.LineWidth = 0.75 App.activeDocument().IsoView5.X = 900 App.activeDocument().IsoView5.Y = 700 App.activeDocument().IsoView5.ShowHiddenLines=False App.activeDocument().AutoDrawing.addObject(App.activeDocument().IsoView5) Gui.activateWorkbench("DrawingWorkbench")