How can I export the Rhino layers to a .stp-file? I found out that I need to create blocks having the same layer names. If this is the only way, how can I create the blocks automatically from all the layers?
Here is a batch export script that exports one STEP file per layer. If the original Rhino file has not been saved, the file browser will come up and ask you to choose a master file name plus a folder. The files will be named “MasterName-LayerName”. If the Rhino file has been named, the export names will be “RhinoFilename-LayerName”. There will still be a choice of export folder, Enter will choose the current folder. Supports sublayers, file name will be the full layer path separated by dashes.
Note:
Set up STEP export scheme before running, as this script will use the last chosen export option. Exports points, curves, surfaces and polysurfaces.
BatchExportSTPByLayer.py (2.3 KB)
Thank you for the fast response, Helvetosaur. Actually, I was looking for a way to pass the layers into only one stp-file.
I know that it works, if one creates as many blocks as layers, then puts the objects of each layer in the corresponding block and then does the export as stp-file. However, I am looking for a way to do this tranformation (i.e., Create block from layer and name the block with the layer name) automatically for all layers. I found a Rhino script (see https://www.modelical.com/en/pack-rhino-objects-one-block-per-layer-scripting/). This script does the transformation, but it gives a syntax error at a certain line (line 41, as far as I remember). The exported stp-file seems to be ok, but I am not sure, due to the mentioned syntax error. How can I correct the Rhino script, so that everything works without a syntax error?
Moved to Rhino for windows
@christian.deltaglia Welcome to the
Please choose a category so your post gets indexed/tagged for quicker/appropriate response.
Hi Christian. This should already work. Be sure to select AP214AutomotiveDesign as the STEP Schema when exporting. AP203 does not support layers.
Thank you Chuck. Do you mean that the script that I found on internet behaves correctly? If this is what you mean, how can I avoid the tedious syntax error message?
No, I didn’t look at the script. STEP does export Rhino layers as layers if you use AP214. You can see this by saving a 3dm to step and reading it back into Rhino. The layers should be there with the correct names.
Dear Chuck, thank you. Yes, you are right, I have just tested it. I saw also that unjoined surfaces of the same layer are saved in the stp-file in layers with the Rhino layer name plus an index. So, you need to join the “joinable” surfaces in the same layer before you do the export. In this way, you get less layers in the stp-file.
The issue is now solved for me.
Hi Christian. Thanks for the update. I’m a little concerned about your comment about the unjoined surfaces. I don’t see that behavior of multiple layers in Rhino, but maybe I’m not trying the exact same thing as you. Are you seeing this when importing your step file back into Rhino or are you seeing it when reading the Rhino-created step file into another product?
Thank you Chuck. I checked this using the Autodesk free online viewer (https://viewer.autodesk.com). There, you see the layer issue I mentioned. Whould be nice to have only one layer in the stp-file even if the objects in the same layer are not joined.
Thanks for the link. I downloaded the viewer and see what you are seeing. I opened a step file that has an exploded box. all six sides on the same layer in the step file, and the viewer created a separate later for each face. Unfortunately, there’s nothing we can do on our side since the creation of the separate layers for each unjoined surface is done by the autodesk step reader, rather than our exporter.
Hi all,
what about converting layers in Rhino to blocks in STP?
Solid modelers usually thinks in terms of elements and assemblies so having a stp file organized as elements (Rhino blocks) make more sense for me.
Also, most of solid modelers do not have layers management.
Solidworks for instance get rid of layer hierarchy when opening a Rhino file.
I think should be important to have strong STP import/exporting capabilities in order to exchange complex files with solid modelers as their support for rhino file is usually poor or null.
I discussed already about this with @pascal here
@Helvetosaur script is quite useful, I think an option for this should be included in Rhino STP export menu, together with the option to export to an unique file (organized in parts according to layer structure) rather than many steps (one each layer as working in the script).
Behaviour could be
- Rhino file with some elements placed on different layers (and sublayers)
- Export to stp:
2.1 Single File: Layers structure is converted to Structure tree including sublayers as subassemblies
2.2 Multiple File Layers are converted to individual files, just like @Helvetosaur script does
@chuck please have a look at this STP viewer as well from NIST
Hoping to see this included soon in Rhino 7? / 8
Thank you
Hello, sorry to revive this veeeeery old topic. Where is this option on choosing which AP2XX is used for the STEP export? I can’t seem to find it. Using Rhino 7.3.2
To whoever may respond, thanks a lot!
Hello- You should probably update your Rhino to the latest V7.
https://www.rhino3d.com/download/archive/rhino/7/latest/
The option is shown as part of the Step export process.
if you do not see that dialog, you can bring it up from this dialog:
-Pascal
Hello, huge thanks! But this window is all I get (in french, sorry) :
As you can see, no AP2XX dialog on my version. This is weird.
Hi Gael - stp is not the same as stl!
-Pascal
OMG huge confusion out here. My bad. Sorry to have you waste your time