diff --git a/freecad/kiconnect/commands/Syncable.py b/freecad/kiconnect/commands/Syncable.py index 42f64ae..e144921 100644 --- a/freecad/kiconnect/commands/Syncable.py +++ b/freecad/kiconnect/commands/Syncable.py @@ -6,13 +6,38 @@ class Syncable: def IsActive(self): sel = Gui.Selection.getSelection() - print(len(sel)) if len(sel) == 0: return False - print(sel, self.SYNCABLES) - for obj in sel: if obj.Type not in self.SYNCABLES: return False return True + + def Activated(self): + selection = [ sel for sel in Gui.Selection.getSelection() if sel.Type in self.SYNCABLES ] + syncables = [] + + if len(selection) == 1: + syncables = selection + else: + syncables = [] + + for i in selection: + for j in selection: + print(selection) + if i == j: continue + + if i in j.OutList: + break + else: + syncables.append(i) + + for s in syncables: + if not hasattr(s, 'Proxy'): continue + + feature = s.Proxy + if hasattr(feature, self.method): + getattr(feature, self.method)() + + s.recompute()