V
V
Vitaly2021-11-17 12:08:04
Visual Basic
Vitaly, 2021-11-17 12:08:04

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.
6194c5f7b7a73075580299.jpeg

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

2 answer(s)
V
Vitaly, 2021-11-18
@HammerZeit

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
6195e568573d4198364574.jpeg
619619704e6c2074212673.jpeg

D
DENIS Kokorev, 2021-11-18
@shmaroder

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

61961a2b0e53d152213134.jpeg

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question