SelectByPolygon error : Out of stack space

Discussion in 'AutoCAD' started by Arnaud Lesauvage, Feb 21, 2005.

  1. Hi all !

    My VBA macro breaks with a "Runtime Error 38 : Out of stack space"
    error when trying to use the SelectByPolygon method.
    The macro works fine but on this drawing, on of the polygons used
    for selection is very complex : >30.000 vertices !

    The selection is done in a loop :

    For Each oAcadLWPoly In oSelSet
    varArray = XYZCoordinates(oAcadLWPoly.Coordinates)
    oSelSet2.SelectByPolygon acSelectionSetWindowPolygon, _
    varArray, gpCode, gpValue
    For Each oAcadEntity In oSelSet2
    oAcadEntity.Layer = "0"
    Next
    Next

    oAcadLWPoly is a LightWeightPolyline, so the XYZCoordinates
    function just returns a 3D array when passed a 2D array as a
    parameter.

    The loop runs flawlessly until it encounters this very large
    polyline.
    Is there a way to add stack space ?

    Thanks for helping !

    Arnaud
     
    Arnaud Lesauvage, Feb 21, 2005
    #1
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.