How to import to layers instead of blocks?

I always have the issue that on import of STEP files from different CAD systems the layer structure of the original CAD system is imported into Rhino as nested blocks.

I HATE NESTED BLOCKS :wink:

Is there any way to enforce Rhino to not import these geometries into nested blocks but on individual layers instead?

My workflow currently means that I have to manually create all these layers, name them logically and drop each item (that arrives in Rhino on a SINGLE LAYER) into each layer - it is a real PITA as you can imagine.

I am sure there is a import function somewhere I overlook to enforce using layers instead of blocks.

Here is the Rhino message upon import:

" Some assembly objects have been imported as Rhino nested block instances.

Use the Explode command to access the geometry in these objects."

Hi Menos - see if the attached plug-in helps - Drag and Drop to add

ExplodeBlocksToLayers

Start the command with no selection and choose the non-default option for how to create layers.
ExplodeBlocksToLayers.rhp (14.5 KB)

Any luck?
Hmmm - I just noticed this is a mac question - I actually don’t know how this thing will work on a mac - it might.

-Pascal

2 Likes

Hey Pascal,

Just as you were typing this I stumbled across your old post here:

The Python script you have shared in that post works amazing!

It does EXACTLY what I would love Rhino to do out of the box :wink:
All nested items are converted from blocks into items on separate layers - I wish I had found that post of yours a few years ago :wink:

It would be truly amazing and sooooooooo useful to implement such a function into the STEP import dialog (offer this functionality in a little popup menu to choose between nested blocks or individual nested layers) instead of the current unhelpful popup message.

Any chance this could be implemented in a future built?

Hi Menos - ok, good, yeah the script should work fine, it’s exactly the same as the plug-in. I’d forgot that I posted that. We’ve talked about adding this and so far the consensus seems to be that it would be much simpler and more generally useful to implement it as a separate post process command than to include it in the import process directly. And, since the script and plug-in seem to work pretty well, there is not a great crowd of developers banging at my door offering to make it ‘real’. Which is not to say it cannot happen, but it’s not yet a priority…

-Pascal

Is there any way to make this script into a button I could place in my menubar?
At least this way I would have a button to press and its easier for me not to forget the procedure of having to run a script, …?

Hello - make a macro like so:

! _-RunPythonScript "Full path to py file inside double-quotes"

(There’s a folder on mac where you can put the py files then you don’t need to full path in the macro, but I don’t know it off hand and don’t have a mac handy at the moment. )

-Pascal

1 Like

That works absolutely beautiful Pascal!

I have created a new button, named it BLOCKS to LAYERS, dropped an appropriate icon to easily find it, have inserted:

! _-RunPythonScript “Full path to py file inside double-quotes”

and the correct path to your script I downloaded earlier and it works absolutely beautiful!

This is amazing - all the time this could have saved me if I would have known earlier!

Thanks a lot, this is incredible!

1 Like