Block cleanup post import

Hi All,

I work with a lot of geometry that is imported from Revit, which seems to always leave me with a huge number of blocks. I suspect this is to do with the export/import and the way Revit represents objects, but I don’t use Revit myself, so couldn’t say more.

Some blocks represent complex objects, and need to stay as blocks. But many many blocks only contain a single piece of non unique geometry. eg, every single identical paling on a fence comes in as a unique block. if it were one block with multiple instances, that would make sense - but they come in as hundreds of separate unique blocks.

Can anyone think of a way to select all blocks that 1) only have a single element in them, and 2) only have a single instance? so that these blocks can be exploded without exploding every block?

Cheers
Ben

Does this script do what you want?

SelUniqueBlockInstancesSnglObj.py (473 Bytes)

2 Likes

You are a hero, sir. That works beautifully.

I’m reasonably proficient with grasshopper, but it’s clearly long past time I dug into scripting directly in Rhino, especially for these more utilitarian tasks.

No, the real heroes are the designers/programmers at McNeel who have allowed us to have such an incredibly detailed access to so many of the underlying functions and details of Rhino. :clap: