Пример #1
0
 def transparentOnold(self, index):
     buttext = self.btns[index].text()
     initialTransparencyState = a2plib.isTransparencyEnabled()
     if 'On' in buttext:
         initialTransparencyState = a2plib.isTransparencyEnabled()
         if not initialTransparencyState:
             a2plib.setTransparency()
         self.btns[index].setText('Transparent Off')
     if 'Off' in buttext:
         self.btns[index].setText('Transparent On')
         a2plib.restoreTransparency()
Пример #2
0
 def clearSelection(self, doc):
     if self.ignoreClear:
         self.ignoreClear = False
     else:
         if a2plib.isTransparencyEnabled():
             a2plib.restoreTransparency()
             FreeCADGui.Selection.removeObserver(self)
Пример #3
0
 def Activated(self, checked):
     if FreeCAD.activeDocument() == None:
         QtGui.QMessageBox.information(
             QtGui.QApplication.activeWindow(), "No active document found!",
             "You have to open an assembly file first.")
         return
     if a2plib.isTransparencyEnabled():
         a2plib.restoreTransparency()
     else:
         a2plib.setTransparency()
Пример #4
0
    def Activated(self):
        doc = FreeCAD.ActiveDocument

        selected = a2plib.getSelectedConstraint()
        if selected is None:
            return

        if not a2plib.isTransparencyEnabled():
            a2plib.setTransparency()

        FreeCADGui.Selection.clearSelection()
        FreeCADGui.Selection.addSelection(
            doc.getObject(selected.Object1), selected.SubElement1)

        FreeCADGui.Selection.addSelection(
            doc.getObject(selected.Object2), selected.SubElement2)

        # Add observer to remove the transparency when the selection is changing or removing
        FreeCADGui.Selection.addObserver(ViewConnectionsObserver())
Пример #5
0
 def IsChecked(self):
     return a2plib.isTransparencyEnabled()
Пример #6
0
 def Activated(self, checked):
     if a2plib.isTransparencyEnabled():
         a2plib.restoreTransparency()
     else:
         a2plib.setTransparency()
Пример #7
0
 def IsActive(self):
     return (a2plib.getSelectedConstraint() is not None and a2plib.isTransparencyEnabled() == False)