Can we code a solution for a selection that is too complex for a function?
e.g., CorelDRAW seems to go into an endless loop when asked to to a Contour on a selection with thousands of nodes; doesn't remove itself from memory but requires Task Manager to shut it down and try again.
One could write a macro to do a contour but set the macro to first count the number of nodes and if > than 500? then pop up a message that says "Too many nodes" and once you hit ok the macro would stop trying to do the contour. The reduce the number of nodes and try again.
Thanks Myron, but I'm contouring a group. No way to check the number of nodes in a group, is there?
You might use FindShapes with a query to see if anything in the selection is a Curve with more than a specified number of nodes.
Or, you could get all of the Curves in a shaperange, then sort them by the number of nodes.
Sub max_nodes_count() Dim sr_curves As ShapeRange Set sr_curves = ActiveSelectionRange.Shapes.FindShapes(, cdrCurveShape) sr_curves.Sort "@shape1.com.curve.nodes.count>@shape2.com.curve.nodes.count" MsgBox "Largest number of nodes in a curve is " & sr_curves.FirstShape.Curve.Nodes.Count & "." End Sub
Thanks Eskimo! That will solve my problem.