Culling curves from file

I’m wondering what a quick way (in terms of script/macro writing and performance) would be to purge a file or export a model from a file(or a bunch of files, I do know how to do that…) that’s been purged of all curves, including ones inside blocks? Preferably I’d like to keep the blocks “blocks,” not just explode and sel all curves delete.

Problem is curves in block instances aren’t actually in the file as objects, they are just in the block definitions. So you can’t select and delete, you would need to go into each block definition and modify it by removing anything defined as a curve. I haven’t looked into if this can be done scriptwise.

Maybe just redefine the block defs using the same name and the same elements minus the curves.

Maybe like this:

import rhinoscriptsyntax as rs

def RemCrvsFromBlocks():
    if not blk_ids: return
    for blk_id in blk_ids:
        #need to get block def name and insertion point
        #get object ids that compose the block
        #remove curves
        for obj_id in orig_obj_ids:
            if not rs.IsCurve(obj_id): sans_crvs.append(obj_id)
        #redefine the block, or delete it if it's all curves
        if sans_crvs:

That certainly seems to do it!