View Single Post
  #1  
Old 04-10-2014, 10:25
nic nic is offline
Member
 
Join Date: May 2009
Posts: 90
Default Working with parts of a curve that has been broken

Hi
the code below adds nodes to a curve and then breaks the curve apart but I dont know how to then work with the new curves (Im intending to recolour them each in a separate colour).

How do you refer to the new objects created when you break a curve apart?
nic

Code:
Dim s as shape, sr as ShapeRange, sp as SubPath, nr as NodeRange 
Set sr = ActivePage.Shapes.FindShapes()

'loop thru shapes
For Each s In sr

   s.Curve.SubPaths.First.AddNodeAt 0.333, cdrRelativeSegmentOffset
   s.Curve.SubPaths.First.AddNodeAt 0.666, cdrRelativeSegmentOffset

    'break nodes and curve
    Set nr = s.Curve.Nodes.All
    nr.BreakApart
    nr.RemoveAll
    s.BreakApart
     
    'bogus code
    's.PART1.Outline.Color.RGBAssign 255, 0, 0
    's.PART2.Outline.Color.RGBAssign 0, 255, 0
    's.PART3.Outline.Color.RGBAssign 0, 0, 255
    
Next s

Last edited by nic; 04-10-2014 at 11:40.
Reply With Quote