本文整理汇总了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"
)