OberonPlace.com Forums

OberonPlace.com Forums (http://forum.oberonplace.com/index.php)
-   CorelDRAW/Corel DESIGNER VBA (http://forum.oberonplace.com/forumdisplay.php?f=16)
-   -   Loop thru shapes and break at nodes (http://forum.oberonplace.com/showthread.php?t=24691)

nic 15-08-2014 15:03

Loop thru shapes and break at nodes
This fails with Node belongs to another shape error - Ive had a read of the previous posts but still cant see how Im to do this. Given the macro is run on a doc which only has curves Im looking for help to make this macro break them all up into two node curves, I can see the nr needs to be reset to blank each time but cant see how to do it. Any help appreciated.


Sub BreakNodes()
    Dim s As Shape
    Dim sr As ShapeRange
    Dim n As Node
    Dim nr As New NodeRange
    Set sr = ActivePage.Shapes.FindShapes()

    For Each s In sr
        For Each n In s.Curve.Nodes
          nr.Add n
        Next n
  Next s

End Sub

shark 17-08-2014 11:23

After nr.BreakApart you need to use nr.RemoveAll.

nic 17-08-2014 15:13

Thanks Shark - that works

dungbtl 11-03-2016 15:26

Hey thats cool.

Now what about reversing it?

Anotherwords, I have single stroke letters for engraving.
Sometimes the characters get broken up at the nodes
resulting in many segments, line/curves.

Anyway to rejoin what is touching?

I could have sworn there was code that does this.

X4 for me :o

nic 11-03-2016 16:14

does this help?



Sub joinCurves()
Dim s As Shape
Dim sr As ShapeRange

Set sr = ActiveLayer.Shapes.FindShapes()
    For Each s In sr
        ActiveShape.CustomCommand "ConvertTo", "JoinCurves", 0.1
    Next s
End Sub

dungbtl 13-03-2016 06:58

Run time error -2421354352345345235

and Shells didnt either because its in X5.

Another time maybe. Thanks

All times are GMT -5. The time now is 06:23.

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2022, Jelsoft Enterprises Ltd.
Copyright © 2011, Oberonplace.com