1. New document
2. Part workbench
3. Create cube
4. Create cylinder
5. Assembly3 workbench
With these actions, the Python console displays:
Code: Select all
Python 2.7.6 (default, Mar 22 2014, 23:03:41)
[GCC 4.8.2] on linux2
Type 'help', 'copyright', 'credits' or 'license' for more information.
>>> App.newDocument("Unnamed")
>>> App.setActiveDocument("Unnamed")
>>> App.ActiveDocument=App.getDocument("Unnamed")
>>> Gui.ActiveDocument=Gui.getDocument("Unnamed")
>>> Gui.activateWorkbench("PartWorkbench")
>>> App.ActiveDocument.addObject("Part::Box","Box")
>>> App.ActiveDocument.ActiveObject.Label = "Cube"
>>> App.ActiveDocument.recompute()
>>> Gui.SendMsgToActiveView("ViewFit")
>>> App.ActiveDocument.addObject("Part::Cylinder","Cylinder")
>>> App.ActiveDocument.ActiveObject.Label = "Cylinder"
>>> App.ActiveDocument.recompute()
>>> Gui.SendMsgToActiveView("ViewFit")
>>> Gui.activateWorkbench("Assembly3Workbench")
>>>
What is the mechanism to get workbench commands to be visible and the Python console and recordable as macros? It works in some other workbenches so there must be a way ...
The reason for this question is that I am trying to figure out a way to have unit tests for Assembly3; the Python console and Macros could be of great help to write the test cases.