Guys
Any Idea how to select objects that are under a curve
Th above show a series of circles and a curve drawn with the freehand tool over some of them
I am trying to make a selection of just the circles that the curve intersects.
I Can do it using SelectShapesFromRectangle but that selects anything in the rectangle and if there are shapes that are in the rectangle but not under the line they are selected as well
I did try using the pen tool to click on each circle to draw the line,I could then get the node positions and select the object below by using SelectShapesAtPoint but I cant work out how to loop through the nodes and add each shape to the selection
Would really appreciate any help
Mark
If those are ellipses, is it OK to convert them to Curves?
If so, then look at the Curve.IntersectsWith method.
I should read the post thoroughly before replying.
Hi Eskimo
Any ideas on usage? cant find any examples on how you would use. I have tried the following
Dim sr As ShapeRange Dim crv As Curve Set crv = CreateCurve(ActiveShape) Set sr = ActiveShape.Curve.IntersectsWith(crv)
and it throws a type mismatch error
The active shape is the line and I have converted all the ellipses below to curves
Thanks
Here's an example.
It should select the shapes that the "marking" curve intersects.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
Sub check_intersects() Dim sr As ShapeRange Dim sr_crossed As New ShapeRange Dim curveMarking As Curve Dim s As Shape Set sr = ActiveSelectionRange Set curveMarking = sr(1).Curve sr.Remove (1) For Each s In sr If s.Curve.IntersectsWith(curveMarking) Then sr_crossed.Add s End If Next s sr_crossed.CreateSelection End Sub
Right If I am understanding ths I have to manually select all the ellipses under the path, add the line then run the macro nothing happens because I have already selected the stones that I am tryingto select. Some of these designs have a thousand of these ellipses ( Its a rhinestone design)
I Then tried selecting all the ellipses and the line including elipses that are not under the line run the macro and nothing changed. Am I Doing something wrong
I Know its possible see video link below and go to 3 mins 28sec you will see him draw a 2 point line between several ellipses and then applies an align and distribute to them to even the spacing and only the ellipses below the line are affected
https://www.youtube.com/watch?v=m_43VsKGLa0&list=PLDqHlDXMNFTr8Bbn_B8HTyvuF6wtRv96k
and this one does selct by curve at 34 seconds
https://www.youtube.com/watch?v=vIoCe3ZCdy8&t=5s