本文整理匯總了Python中FreeCAD.GuiUp方法的典型用法代碼示例。如果您正苦於以下問題:Python FreeCAD.GuiUp方法的具體用法?Python FreeCAD.GuiUp怎麽用?Python FreeCAD.GuiUp使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類FreeCAD
的用法示例。
在下文中一共展示了FreeCAD.GuiUp方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: Activated
# 需要導入模塊: import FreeCAD [as 別名]
# 或者: from FreeCAD import GuiUp [as 別名]
def Activated(self):
"""This function is executed when the workbench is activated"""
if App.GuiUp:
self.isObserving = True
self.Selection = []
self.View_Directions = []
Gui.Selection.addObserver(self)
return
示例2: Activated
# 需要導入模塊: import FreeCAD [as 別名]
# 或者: from FreeCAD import GuiUp [as 別名]
def Activated(self):
flags = QtGui.QMessageBox.StandardButton.Yes | QtGui.QMessageBox.StandardButton.No
response = QtGui.QMessageBox.information(
QtGui.QApplication.activeWindow(),
u"Migrate proxies of importedParts to recent version",
u"Make sure you have a backup of your files. Proceed?",
flags
)
if response == QtGui.QMessageBox.Yes:
doc = FreeCAD.activeDocument()
for ob in doc.Objects:
if a2plib.isA2pPart(ob):
#setup proxies
a2p_importedPart_class.Proxy_importPart(ob)
if FreeCAD.GuiUp:
a2p_importedPart_class.ImportedPartViewProviderProxy(ob.ViewObject)
#delete obsolete properties
deleteList = []
tmp = ob.PropertiesList
for prop in tmp:
if prop.startswith('pi_') or prop == 'assembly2Version':
deleteList.append(prop)
for prop in deleteList:
ob.removeProperty(prop)
QtGui.QMessageBox.information(
QtGui.QApplication.activeWindow(),
u"The proxies have been migrated.",
u"Please save and reopen this assembly file"
)