_SelBoundary using multiple curves

Hello all,

I was wondering, I have a fairly intricate object that I need to pull off a section from. Due to the nature of the object I can see lots of lines inside the object under the cut line.

I can use _SelBoundary to select the curves inside the cut lines and delete them. However I have a lot to clear though, Is there a way to run _SelBoundary or a similar command to select all the curves within my cut objects

So all the red curves should be empty inside has anyone had any similar problems or found any sort of workaround?

You might try this script to trim a series of curves inside/outside multiple closed boundaries. Select the boundary curves first, then the curves to trim.

–Mitch

MultiNestedBoundaryTrimCurves.py (4.1 KB)

Thank you, but I don’t think that’s quite it,

The curves aren’t joined so they don’t need to be trimmed but completely deleted and the script requires the selection of all the the curves that need to be cut. There would be way over a 1000 curves to select this way.

At the moment running the macro:

_SelBoundary
_Pause
_Delete

allows me to select one cutting curve at a time and clear it, but that still doesn’t feel like the most efficient way to do it.

-Sash

No, a window selection or SelAll or SelCrv allows you to select as many curves as you like… Here is a video example with a couple of thousand curves and two closed trim boundaries. It takes a few seconds when you have a lot of curves, but it’s pretty reliable. It also deletes any curves entirely inside (or outside) the trim boundaries, even if they weren’t trimmed. I use it a lot to trim terrain maps with many thousand curves.

–Mitch

The following will also work as a hack if you just want to select curves with multiple closed boundaries:

import rhinoscriptsyntax as rs

def cCrv_filt(rhino_object, geometry, component_index):
    return rs.IsCurveClosed(geometry)

def SelMultipleBoundary():
    msg="Select closed boundary curves"
    b_crvs=rs.GetObjects(msg,4,preselect=True,custom_filter=cCrv_filt)
    if not b_crvs: return
    
    rs.EnableRedraw(False)
    for crv in b_crvs:
        comm="_SelBoundary _SelectionMode=_Window _Precise=_Yes SelID {}".format(crv)
        rs.Command(comm,False)
SelMultipleBoundary()
1 Like

Wow…

Okay thank you so much you have made my life so much easier.