Giving this thread a nudge. Comment was made that it’s earmarked for development in V8, yet the YouTrack hasn’t been updated in a long time and there’s been no sign of it to date in V8 Beta.
Is it going to happen any time soon? Now that object properties and metadata has been made a feature worthy of the name in V8, AP242 would seem to be the ideal way to port all of this lovely information to other CAD packages. And then there’s curves, text, PLM data - all of that stuff.
My local build of V8 has the ability to save as AP242, although it does not save any of the things you are hoping for - just what we currently handle in AP214. I’ll make that public as soon as I’m sure I’m done with some minor tweaks to V7 STEP. It will not be a small task to get true AP242 import and export. We are working on it and do hope to have something worthwhile for V8.
Maybe this is a bit out of topic but I wanted to chime in as we are dealing with STEP.
Do you plan to implement also Part → Block / Layer conversion for STP as SolidWorks files are currently imported?
Please find discussion here
I can successfully import a STP file and have parts converted in blocks then to layers using this great plug-in from Pascal
Nevertheless it is not yet possible to export a Rhino file to STP converting layers to blocks on the fly.
This way I can keep my original layer hierarchy as blocks become parts in the solid modeler which will open the STP file.
I had already some discussion with @pascal but is not clear for me if we have just to wait for a new plug-in from him or if this feature has been filed among requests and will be implemented sometime in Rhino.
Thank you all again for the great work you are doing.
I know the resources are limited but I think that import/export capabilities are crucial to Rhino.
This is more complicated than it sounds. A Rhino document can have both layers and blocks, as can a STEP file. If a file contains both, there could be a problem. A script like @pascal wrote for changing blocks to layers wouldn’t really work here since it would change your 3dm data to something you don’t want. I guess you could undo that after exporting but that shouldn’t be necessary. I need to think about this some more.
Ok, I didn’t thought of this.
Importing it’s easier as new geometry it’s simply dropped in a fresh file.
Export is a bit different, let’s think about it!
thanks
I am working on a python script to do this, but I am not a programmer myself, so I got stuck and wasn’t able to evolve it.
Right now what it does, it selects the objects by layer and creates a block with the layer name.
What I am stuck is on the recursive solution, it works once, and create blocks for every (sub)layer that has a object, but, I wasn’t able to make it create the subsequent blocks with blocks for the tree to become complete, so I do the subsequent steps by hand.
For my application it is working for now. MakeLayersIntoBlocks.py (2.5 KB)
Also it asks for selection of the folder, because I planned for it to export the step file in the end, however, as I wasn’t able to finish it yet it does nothing with the folder selection.
ps. The export must be STEP 214, then the layer structure will be translated into an “assembly like” tree for the solid modeler.
I transfer with success the parts into NX and Solidworks with this script.
is this something you are looking for?
I stripped your original script, sorry for that.
Maybe I misunderstood your intention, but that’s what I would come up with.
def BatchBlockByLayer():
rs.EnableRedraw(False)
layers=rs.LayerNames()
content = []
for layer in layers:
items = [x for x in rs.ObjectsByLayer(layer) if rs.IsBlockInstance(x) == True]
if items != []:
taxi = []
for item in items:
name = rs.BlockInstanceName(item)
transform = rs.BlockInstanceXform(item)
definition = sc.doc.InstanceDefinitions.Find(name)
refGeo = Rhino.Geometry.InstanceReferenceGeometry(definition.Id, transform)
taxi.append(refGeo)
subBlockIndex = sc.doc.InstanceDefinitions.Add(layer, "", Rhino.Geometry.Point3d.Origin, taxi)
subIRef = sc.doc.Objects.AddInstanceObject(subBlockIndex, Rhino.Geometry.Transform.Identity)
content.append(subIRef)
rs.EnableRedraw(True)
BatchBlockByLayer()
I do not understand this part:
ps. The export must be STEP 214, then the layer structure will be translated into an “assembly like” tree for the solid modeler.
I transfer with success the parts into NX and Solidworks with this script.
Can you paste a screenshot of how the structure looks like?
My experience tells me that usually not the layers but the blocknesting is decisive for the trees.
But I might be wrong.
@MattE STEP Import isn’t really dependent on the protocol. We look in the files for entities we support and read them. There is no difference here in 242 over 214. I did add import of point clouds to V8 but I no idea if it works, since I’ve not been able to find a STEP file that has one.
I added the ability to export to 242 last year as well. The result should be a valid AP242 file, but will only be cosmetically different from a 214 file. You should have AP242 at the bottom of the dropdown list.
I hope that we will be adding for complete support, but much of 242 that we don’t yet support will require creating new types of Rhino objects. This will be a major undertaking requiring several developers.
Yes, sorry. V8 WIP only. It has replaced the CC2 thing, which was a variation of 214 when we first did the STEP exporter. Some companies required it, although there was nothing different in the file other than the line that said which schema was used.
The objective here is literally reverse the ExplodeBlocksToLayers from @pascal
So it should Block the SubLayer³ With Geometry First, using the layer name as the block name
then Block the Sub² with geometry including the Sub³ blocks from the previous step, again with the Sub² layer name as the block name.
Then block the Sub layer with the previous blocks inside of it (select sublayer objects basically) using the Sub layer name as the block name
And finally block the Main layer with its name as the block name.
Exporting the Main Layer Block as step 214 makes so NX (I did tried once with solidworks and it worked too) interprets the assembly combination.
So the Main Layer Block becomes the main Assembly file, the subsequent blocks, if they have nested blocks in then, become sub assemblies as well, or if they only have geometries, they become Part files.
My programming skills are still in development and I got stuck in the recursive part of the block building. So my script is only building each layer to a block, but it does not go from bottom to top to build the STEP Assembly tree. So I use it once to block the majority of the things and then redo it by hand where necessary.
That is correct. In the V8 WIP, AP242 is one of the export options. In a post I made here last month, I incorrectly stated that AP242 has replaced AP214AutomotiveDesignCC2. In fact, there are now 4 choices. The original three including CC2, and 242.
Hello Chuck;
I typically use; SolidWorks, Spaceclaim, and Rhino with STEP files as the file exchange format.
The company I typically do design work with uses Inventor, again with STEP files.
STEP files being the common denominator.
I have been trying to work freely between these programs and Rhino having some success but not having a clear solution.
Is there a best practice that can be used that would make this interchange work seamlessly?
I sometimes shy away from using Rhino because of this, even when Rhino would clearly be the best design tool choice.
Thank you, Eric
Hello Pascal;
The Design Tree (SpaceClaim) & Feature Manager (Solidworks) list the parts and assemblies.
I have to maintain this with Inventor as well. In Rhino I have to make a block to have the STEP file export parts into the design tree. The block manager in Rhino helps but organize things but becomes difficult when I have a large number of parts. When going from Spaceclaim to Rhino I save Spaceclaim parts mapped to Rhino layers as 3dm files which works well when moving to Rhino. However I have not found a great method when going from Rhino back to Spaceclaim or Solidworks and having the parts ending up in the Design Tree. If I keep the parts as blocks the model becomes cumbersome to work with in Rhino when I make changes that affect many parts / blocks.
I am hoping to find and easy way to go back and forth with the design files in the best possible way that keeps the files organized in a way that works best when working in each respective program.
Thank you for your help and understanding!
Eric
Good morning Pascal;
Yes, this sounds good.
What is the best way of re-creating Nested Blocks from Rhino Layers / Nested Layers and then exporting to a STEP file.
Thank you!
Eric
Hi Eric - that is a bit of work - and I am not sure how completely reliable it could be - for example, identifying identcal objects and making them instances of a single block definition seems like it would be needed but challenging. But it seems at least possible if that would help the situation.