How to reselected curves Create Planar Breps?

I create planar breps with closed curves. How i can reselected them?
ask

import rhinoscriptsyntax as rs
import scriptcontext as sc
import Rhino
import math
def CrtBep(crvs):
    curves = [rs.coercecurve(id,-1,True) for id in crvs]
    tolerance = sc.doc.ModelAbsoluteTolerance
    breps = Rhino.Geometry.Brep.CreatePlanarBreps(curves, tolerance)  
    return breps
if __name__=='__main__':
    crvFind=rs.GetObjects('Select crv',4)
    CrtBep(crvFind)

Hi,

You will need to add the created breps to the document.

import rhinoscriptsyntax as rs
import scriptcontext as sc
import Rhino
import math
def CrtBep(crvs):
    curves = [rs.coercecurve(id,-1,True) for id in crvs]
    tolerance = sc.doc.ModelAbsoluteTolerance
    breps = Rhino.Geometry.Brep.CreatePlanarBreps(curves, tolerance)  
    return breps
if __name__=='__main__':
    crvFind=rs.GetObjects('Select crv',4)
    #collect breps output
    breps = CrtBep(crvFind)
    #use python generator to get a list of id's from adding each brep to the document
    brep_ids = [sc.doc.Objects.AddBrep(brep) for brep in breps]

Does that help?
-Willem

I need to reselect the curves I created brep or I want to select the curves on the brep.
Thank you!
ask1

Im misread your question.

rs.SelectObjects(crvFind)

Does that work?

ask2
I want to group them together by brep. Is there any way to do that? we have 4 groups are there.

Once you have your breps, create a loop in your script and for each brep, duplicate the edge curves, add them to the document and then group them.


I used the same method but I had a problem. How to get all objects between 2 closed curves (red color ) .