I think it would speed up things a lot to be able to activate and deactivate CutView property with a right click on the section plane entity on the treeview.
I think this is the right topic https://forum.freecadweb.org/viewtopic.php?t=10255 but i couldn't manage to understand how to correctly place inside the code.
I tried to add this code to the viewprovider section plane:
Code: Select all
def setupContextMenu(self,vobj,menu):
from PySide import QtCore,QtGui
action1 = QtGui.QAction(QtGui.QIcon(":/icons/Draft_Edit.svg"),"Swich on/off Cutview",menu)
QtCore.QObject.connect(action1,QtCore.SIGNAL("triggered()"),self.contextCutview(vobj))
menu.addAction(action1)
def contextCutview(self,vobj):
if vobj.CutView:
vobj.CutView = False
else: vobj.CutView = True
What am I doing wrong?