There is a function in the api called RemoveOverlaps, which seeks for overlaps in one curve. Is there a way to use this function over multiple curves from multiple shapes?
In short i try to remove double lines in my drawing soo my lasercutter does not cut that line twice.
My approach - sort of brute force ;) Slow on complex and large number of objects.
Sub Cut()If ActiveSelectionRange.Count = 0 Then Exit SubEnd IfDim s, sCopy As Shape, l, temp As Layer, sr As ShapeRange, srCount As Integer, coll As New CollectionActiveDocument.Unit = cdrMillimeterActiveDocument.BeginCommandGroup "Get curves cut ready"Optimization = TrueEventsEnabled = FalseActiveDocument.PreserveSelection = FalseSet l = ActiveDocument.ActiveLayerSet sr = ActiveSelectionRangeSet temp = ActivePage.CreateLayer("Temp")sr.MoveToLayer tempFor i = 1 To sr.Shapes.Count Set s = sr(i) If s.Type <> cdrCurveShape Then s.ConvertToCurves s.Curve.Nodes.All.BreakApart s.BreakApart Dim tempSr As ShapeRange Set tempSr = ActiveSelectionRange coll.Add tempSr Next iFor i = 1 To coll.Count Set sr = coll(i) For j = 1 To sr.Count Set s = sr(j) Set sCopy = s.Duplicate(0, 0) sCopy.Outline.width = 1 sCopy.Outline.ConvertToObject For k = 1 To coll.Count If k <> i Then Dim sr1 As ShapeRange Set sr1 = coll(k) srCount = sr1.Count For h = 1 To srCount Set s = sr1(h) Set s = sCopy.Trim(s, True, True) If Not s Is Nothing Then sr1.Add s End If Next h For m = srCount To 1 Step -1 sr1(m).Delete sr1.Remove m Next m End If Next k sCopy.Delete Next jNext iActiveDocument.ActiveLayer.Shapes.All.MoveToLayer ltemp.DeleteActiveDocument.ClearSelectionOptimization = FalseActiveDocument.PreserveSelection = TrueEventsEnabled = TrueApplication.RefreshActiveDocument.EndCommandGroupEnd Sub