Here’s a Python that will nuke all blocks and turn any existing instances into regular objects. It asks no questions, it just does it…
import rhinoscriptsyntax as rs
x = rs.BlockNames()
if not x: return
y = rs.ObjectsByType(4096)
for Id in blocks:
blocks = rs.ExplodeBlockInstance(Id)
if blocks: explode_em(blocks)
for z in y:
for block in x:
@wim: Thanks! Worked well once all blocks were exploded.
@pascal: Thanks! This also worked once all blocks were exploded. I tried running this script after opening the Solidworks STEP file, before exploding all blocks, but no luck. Is it supposed to work in this fashion?
If so, here’s the error message I got running the script in Atom. Perhaps this relates to nested blocks (which the file does have)? ~Dave