Answer the question
In order to leave comments, you need to log in
Corel Draw VBA how to merge curves?
Hello!
I need to weld several curves and then split the curve into separate ones (ctrl+K).
The macro recorder works for a particular case, the macro does not work on other curves.
Sub Macro1()
Dim OrigSelection As ShapeRange
Set OrigSelection = ActiveSelectionRange
Dim s1 As Shape
Set s1 = OrigSelection(2).Weld(OrigSelection(1), True, True)
OrigSelection(1).Delete
OrigSelection(2).Delete
Dim brk1 As ShapeRange
Set brk1 = s1.BreakApartEx
End Sub
Answer the question
In order to leave comments, you need to log in
Yes, I put it incorrectly - not other curves, but a different number of curves. There are 2 of them in my macro and it does not process the third curve. If you make a macro for 3 curves and put 2 on it, there will be an error
Seem to be? 100 years did not pick up VB.
Sub Macro1()
Dim OrigSelection As ShapeRange
Set OrigSelection = ActiveSelectionRange
Dim s1 As Shape
Dim count As Integer
count = OrigSelection.count
Set s1 = OrigSelection(count)
For i = count - 1 To 1 Step -1
Set s1 = s1.Weld(OrigSelection(i), True, True)
Next i
OrigSelection.Delete
Dim brk1 As ShapeRange
Set brk1 = s1.BreakApartEx
End Sub
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question