Sel crossing with python


I need to select some curves. I know the curves are placed on the Xaxis.

If i was drawing in rhino i would use the selcrossing command. but i cant find an alternative for it in python. Can anyone help me?

Thanks in advance


Maybe this will help…


Very helpful

and other thing im struggling with is to split curves with a plane(WorldZXPlane).

Any advice?

here’s one example…

(Intersection events are somewhat complicated to handle)

import rhinoscriptsyntax as rs

def SplitCrvsWPlane():
    crvs=rs.GetObjects("Select curves to split with plane",4,preselect=True)
    if not crvs: return
    #can change this
    for crv in crvs:
        #for each curve, intersect with the plane
        if insec:
            #empty list to hold intersection parameters
            for event in insec:
                #add parameter of point intersection (or near end of overlap)
                #rs.AddPoint(event[1]) #uncomment to put point at intersection
                if event[0]==2:
                    #overlap intersection, add parameter of far end of overlap
                    #rs.AddPoint(event[2]) #uncomment to put point at intersection
            #split curve at all parameters found, delete originals

Otherwise you can get the bounding box of all curves, create a plane surface big enough to cover all the curves, then script rs.Command(“Split”) to split the curves with the plane (then delete the plane).

HTH, --Mitch