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?

1 Like

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!

2 Likes

Hi @pascal
I was struggling with the same problem until I found this post
Many many thanks about this!
It solves a lot of interexchange problems.

Actually this option exist already in Solidworks import dialog which I find really useful.
Maybe itā€™s time to rethink about adding this to Step import as well?

P.S. I just checked on your page but this plugin/script is missing. Please add it (or better bring inside Rhino!)

Hi @pascal
I am playing with Step files trying to fix the inability of Solidworks to import 3dm files keeping layers structure.
Is it possible to perform opposite action: trasform layer + layer structure to blocks?
Doing so Rhino files could be exported to any Solid Modeler keeping layers hierarchy!
It would resolve many export issues.
Thanks!

If I understand what youā€™re asking for, Iā€™ve looked at this, and made a more or less working thing, a few years ago, but never got the kinks worked out well enough to ā€˜publishā€™. I am pretty sure the bottleneck was lack of time and bandwidth, and not anything technical.

-Pascal

1 Like

Hello @pascal
I think it would add a useful feature to Rhino.
It could be just a script which work the same way (but opposite to your ExplodeBlocksToLayers)
and/or
an option added to STEP import/export.

Just let me know if I can help you some how,
thanks!

Hi @pascal
I found on a old thread a script by @Helvetosaur

but it ā€œflattenā€ layer structure to the first level.
Do you think youā€™ll be able to publish your script/plugin sometime?

As told above I think it could be very useful to export Rhino files to solid modelers without losing layers (which are NOT supported by most modelers)

Thanks!

Hi @pascal ,
sorry if I bother you again but would like to know if you managed to deal this.
I need quite often to export geometry from Rhino to STP and I would like to preserve layer structure.
Please confirm if you have read my latest posts and everything clear.
Thanks!

Hi Luca - I think I get itā€¦ but no, I have not typed anything. Iā€™d love to give it a try, I just do not know if I have the time at the moment.

-Pascal

1 Like

Ok, thanks a lot Pascal!

The best way for me would be have this feature implemented in STP import/export options.
Has this been filed already?