BIM: Only dusplay context menu items when in BIM WB - fixes #17043
This commit is contained in:
committed by
Chris Hennes
parent
40616bb119
commit
f4d213d299
@@ -97,6 +97,9 @@ class ifc_vp_object:
|
||||
from nativeifc import ifc_materials
|
||||
from PySide import QtCore, QtGui # lazy import
|
||||
|
||||
if FreeCADGui.activeWorkbench().name() != 'BIMWorkbench':
|
||||
return
|
||||
|
||||
icon = QtGui.QIcon(":/icons/IFC.svg")
|
||||
element = ifc_tools.get_ifc_element(vobj.Object)
|
||||
ifc_menu = None
|
||||
@@ -404,6 +407,9 @@ class ifc_vp_document(ifc_vp_object):
|
||||
|
||||
from PySide import QtCore, QtGui # lazy import
|
||||
|
||||
if FreeCADGui.activeWorkbench().name() != 'BIMWorkbench':
|
||||
return
|
||||
|
||||
ifc_menu = super().setupContextMenu(vobj, menu)
|
||||
if not ifc_menu:
|
||||
ifc_menu = menu
|
||||
@@ -584,6 +590,9 @@ class ifc_vp_material:
|
||||
from nativeifc import ifc_psets
|
||||
from PySide import QtCore, QtGui # lazy import
|
||||
|
||||
if FreeCADGui.activeWorkbench().name() != 'BIMWorkbench':
|
||||
return
|
||||
|
||||
icon = QtGui.QIcon(":/icons/IFC.svg")
|
||||
if ifc_psets.has_psets(self.Object):
|
||||
action_props = QtGui.QAction(icon, "Expand property sets", menu)
|
||||
|
||||
Reference in New Issue
Block a user