def SplitSketch(self, object): sketch = object sketch.__class__ = cad.Sketch new_sketches = sketch.Split() cad.StartHistory() cad.DeleteUndoably(object) for sketch in new_sketches: cad.AddUndoably(sketch, object.GetOwner(), None) cad.EndHistory()
def FitArcs(self, object): value = self.InputLength('Set tolerance for Fit Arcs', 'tolerance', geom.get_accuracy()) if value != None: geom.set_accuracy(value) sketch = object sketch.__class__ = cad.Sketch curve = sketch.GetCurve() curve.FitArcs() cad.StartHistory() cad.DeleteUndoably(object) cad.AddUndoably(cad.NewSketchFromCurve(curve)) cad.EndHistory()
def Run(self, event): cad.DeleteUndoably(self.object)
def OnCut(self, e): self.CopySelectedItems() cad.StartHistory() for object in cad.GetSelectedObjects(): cad.DeleteUndoably(object) cad.EndHistory()
def OnDelete(self, e): cad.StartHistory() for object in cad.GetSelectedObjects(): cad.DeleteUndoably(object) cad.EndHistory()