Exemplo n.º 1
0
    def setSelection(self, doc):
        selected = a2plib.getSelectedConstraint()
        if selected is not None:
            self.ignoreClear = True
            FreeCADGui.Selection.clearSelection()
            FreeCADGui.Selection.addSelection(
                FreeCAD.ActiveDocument.getObject(selected.Object1), selected.SubElement1)

            FreeCADGui.Selection.addSelection(
                FreeCAD.ActiveDocument.getObject(selected.Object2), selected.SubElement2)
Exemplo n.º 2
0
    def Activated(self):
        self.selectedConstraint = a2plib.getSelectedConstraint()
        if self.selectedConstraint is None:
            QtGui.QMessageBox.information(
                QtGui.QApplication.activeWindow(),
                translate("A2plus_constraintDialog","Selection Error !"),
                translate("A2plus_constraintDialog","Please select exact one constraint first.")
                )
            return

        self.constraintValueBox = a2p_ConstraintValuePanel(
            self.selectedConstraint,
            'editConstraint'
            )
        QtCore.QObject.connect(self.constraintValueBox, QtCore.SIGNAL("Deleted()"), self.onDeleteConstraint)
        QtCore.QObject.connect(self.constraintValueBox, QtCore.SIGNAL("Accepted()"), self.onAcceptConstraint)
        a2plib.setConstraintEditorRef(self.constraintValueBox)
Exemplo n.º 3
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())
Exemplo n.º 4
0
 def IsActive(self):
     return (a2plib.getSelectedConstraint() is not None and a2plib.isTransparencyEnabled() == False)