View Single Post
  #1  
Old 15-08-2014, 15:03
nic nic is offline
Member
 
Join Date: May 2009
Posts: 90
Default 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.

Code:
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
        
        nr.BreakApart
        s.BreakApart
                       
   Next s

End Sub

Last edited by nic; 15-08-2014 at 15:27.
Reply With Quote