I am using Grasshopper to generate parameterized breps. I would like to use RhinoScript in Python to generate many parameterizations of breps and save them as .3dm files. I have not been successful in trying to export the breps and would like some help. Here is my script:
grasshopper = Rhino.RhinoApp.GetPlugInObject('Grasshopper')
grasshopper.EnableSolver()
grasshopper.RunSolver(True) # Force a complete recompute
fname = "test.3dm"
file_path = os.path.join(save_dir, fname)
brep_id = rs.GetObject("Select the BRep to export", rs.filter.polysurface)
print(brep_id)
rs.SelectObject(brep_id)
rs.Command(f"-_Export \"{file_path}\" _Enter", True)
brep_id returns None. I don’t know what I should do to fix the problem and I tried searching through the forums but none of the posts have been helpful. I would appreciate any help. Happy to provide more details if required. Thanks!