I should have guess what the setCurrentIndex was doing.
I'm in Part design-sketcher, from macro how to click the close button
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
Re: I'm in Part design-sketcher, from macro how to click the close button
This does work (see below), it closes sketcher, and switches to tree mode. It doesn't work in my macro but I will look into that. Thanks.
Code: Select all
import FreeCAD
import FreeCADGui
import time
from pivy import coin
import FreeCAD as App, FreeCADGui
from PySide import QtGui,QtCore
Gui.ActiveDocument.resetEdit()
App.ActiveDocument.recompute()
App.ActiveDocument.commitTransaction()
FreeCADGui.getMainWindow().findChild(QtGui.QDockWidget, "Combo View").findChild(QtGui.QTabWidget).setCurrentIndex(0)
Re: I'm in Part design-sketcher, from macro how to click the close button
This works here, even if combo view is switched to Model.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.