View Single Post
  #1  
Old 11-03-2016, 11:47
nic nic is offline
Member
 
Join Date: May 2009
Posts: 90
Default Break at specified node

Im trying to find the middle node on curves which have only one sub-path but a variable number of nodes, and then split the curve into two objects but struggling with syntax - I first check to see there are at least 3 nodes and then

Code:
Set sh = sr.Shapes(n)
 ndCnt = sh.Curve.Nodes.All.Count
 ndSplit = Int(ndCnt \ 2)
 Set nr = sh.Curve.Node(ndSplit)
 
nr.BreakApart
nr.RemoveAll
srBrokenCurves.AddRange sh.BreakApartEx
This fails at 'Set nr = sh.Curve.Node(ndSplit)' with 'Object dosent support this property/method"

EDIT:

This works
Code:
ndCnt = sh.Curve.Nodes.Count
 'check there are at least 3
     If ndCnt > 2 Then
           'set the node to be split on
            ndSplit = Int(ndCnt \ 2) + 1
            Set nd = sh.Curve.Nodes(ndSplit)
            nd.BreakApart
nic

Last edited by nic; 13-03-2016 at 15:12.
Reply With Quote