Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to select all nodes in a curve and then break them apart?

19 views
Skip to first unread message

sweetman

unread,
Jul 11, 2004, 6:21:05 PM7/11/04
to corel.graphic_apps.draw-script

Hi all,
I would like to create a macro that:
1- selects all objects in a page
2- combines them
3- select all nodes of the selected curve
4- breaks all nodes (break curve) apart
5- breaks apart the curve

so that I obtain a series of single segments/curves

I'm able to create only the first 3 steps above. Apart from this I can
find the correct commands to use.

Any suggestion would be very appreciated.

Thanks in advance.

tony
---
SweetMan = Tony =).

Peter Clifton

unread,
Jul 11, 2004, 8:50:50 PM7/11/04
to corel.graphic_apps.draw-script

sweetman spoke unto the group and said...

>
> Hi all,
> I would like to create a macro that:
> 1- selects all objects in a page
> 2- combines them
> 3- select all nodes of the selected curve
> 4- breaks all nodes (break curve) apart
> 5- breaks apart the curve
>
> so that I obtain a series of single segments/curves
>
Don't think the combine operation is necessary, however if you double
click on the pick tool (to select all objects) and run this macro it
should work.

HTH

Peter

Sub ExplodeToCurves()

Dim s As Shape
Dim I As Long
Dim shr As New ShapeRange

Set shr = ActiveSelectionRange

For Each s In shr
If s.Type <> cdrCurveShape Then s.ConvertToCurves
'if shape converted to a curve object proceed
If s.Type = cdrCurveShape Then
'Break First node in closed curve apart
s.Curve.Closed = False
'Step through each node in open curve breaking apart
For I = s.Curve.Nodes.Count To 1 Step -1
s.Curve.Nodes(I).BreakApart
Next I
s.BreakApart 'Break apart all segments in curve
Else
End If
Next s

End Sub

sweetman

unread,
Jul 12, 2004, 11:06:07 AM7/12/04
to corel.graphic_apps.draw-script

Thanks, Peter,

this was just what I was searching for.

I'll try it soon.

Thanks again.

tony

Alex Vakulenko

unread,
Jul 13, 2004, 12:17:32 AM7/13/04
to corel.graphic_apps.draw-script

Peter,

Nice job! Here is a slightly modified (and faster) version of your macro:

Sub ExplodeToCurves()
Dim s As Shape

For Each s In ActiveSelectionRange


If s.Type <> cdrCurveShape Then s.ConvertToCurves

If s.Type = cdrCurveShape Then

s.Curve.Nodes.All.BreakApart
s.BreakApart

Peter Clifton

unread,
Jul 13, 2004, 1:32:28 PM7/13/04
to corel.graphic_apps.draw-script

Alex Vakulenko spoke unto the group and said...

> s.Curve.Nodes.All.BreakApart

That's the bit. A new function to add to the repertoire ;-)


Thanks

Peter

0 new messages