How to import a step file with part name in Rhino7?

I would like to open a step file on Rhino7 to get the part name, how can I find it?
I attach a sample data. I can’t find the part name “SG1” anywhere in Rhino.
Is there any way to do this, including the grasshopper and script method?

sg1-c5-214.stp (23.3 KB)

PartBody can be found in the properties panel.

If you open the Step data in a text editor, the FACE has the name PartBody.

So the polysurface loaded into Rhino has the name PartBody.

Why don’t you change PartBody to SG1 before exporting Step in Catia?

Thank you for your kind response.

Since the available design data defines part names as “Product” (which I think is very common), I consider whether it is possible to get the part name defined in the product of the step file.

I made it in GH, but I don’t know if it will work in other STEP file.
You will also need to install Pancake. (12.7 KB)

Sorry for the late reply.
Thank you for your kind consideration.
However, as you are concerned, if there is more than one part, the result will be incorrect.
This is because the order in which they are imported in Import3dm does not always match.
sg1-c5-214_V2.stp (89.7 KB) (21.3 KB)

Hello- thanks for the example file, I’ll take a look.
@谷口智之 are these four identical parts with identical names in Catia? Here, in Rhino I only see



Thank you for your reply.
Yes. This is when opened in Fusion360, there are 4 part names (SG1,SG2,SG3,SG4). These are not the same as the names of the Brep.

This definition can be very helpful to me also, but I do get an error:

Looks like I can’t import any STEP file in Grasshopper (Rhino6) using the “Import 3DM” component.

It seems that Pancake’s Import Form can also be read instead of Import 3dm.

However, if there are multiple Bodies, the order seems to be wrong.

I tried that but seems that the C# script can’t handle that:

Nothing is output from C# out.
If you press the button, it will be baked.

I changed the strings in the contents of the STEP file and re-saved the STEP file again.

It is a string manipulation rather than a parametric one.
There may be a better way. (21.3 KB)

My solution: (14.6 KB)

Thank you all for your contributions. However, I am sorry to say this, but in general, the STEP file does not make sense in the order of its lines.
For example, the attached file would give the wrong result.
sg1-c5-214_V3.stp (89.7 KB)

Thank you for your consideration.
However, I apologize for the lack of clarity, but the correct name is SG1-4, starting from the one closest to the origin.
This is because the order of the breps read in pcImportFrom and the order of the names read as text are different.

I’m sorry I can’t help you because I don’t know what exactly you want to do.

Considering what you probably want to do, I would suggest that you consider creating a macro in CATIA or using a plug-in that can read CATIA files into Rhino without using STEP.

I apologize for the lack of clarity, as I can only provide sample data.

What I want to do is very simple:
How to import the step file with part names, not in a way that depends on the sample data.
But apparently it is very difficult with Rhino7.

Special thanks to @11159 Masaki for contributing so much.

@谷口智之 is the first part of the filename always the part name? then it’s easy