當前位置: 首頁>>代碼示例>>Python>>正文


Python FreeCAD.GuiUp方法代碼示例

本文整理匯總了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 
開發者ID:tomate44,項目名稱:CurvesWB,代碼行數:10,代碼來源:init_gui.py

示例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" 
            ) 
開發者ID:kbwbe,項目名稱:A2plus,代碼行數:32,代碼來源:a2p_importpart.py


注:本文中的FreeCAD.GuiUp方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。