STEP attributes

Rhino can read STEP files, but all the associated data is lost.
tutorial.step (19.9 KB)

Does rhino have any support to read such attributes from STEP?
It would super-duper-awesome if these strings would be kept rhino object user strings.

By data I mean simple key value pairs you can see in the image below on the right side:

4 Likes

Hi @Petras_Vestartas ,
I think this is why IFC is used (upcoming replies: ā€œNot true, IFC is based on a schemaā€¦ā€) :slight_smile:

You can try to read the STEP file itself as a .txt file. Because it is basically a text file.
Then check for those tags (SDAI, product…) in the text, and extract its values.

I think this is the only way.

HI Petras -

I’ve added the feature request: RH-88499 File IO: STEP MetaData
-wim

7 Likes

Thank you, hopefully this will be available :slight_smile:

Hi Petras,

Thank you for the stp file you gave Wim with metadata in it. I think it’s what we need. However, even as simple as it is, it would be handy to have something simpler yet. Is there any chance you could make a stp file that has a single line, or point, with one userdata attached? It’s really tricky following through all of the connections in a step file (I’m doing it in a text editor) and I’m hoping this will help me figure it out.

Cheers,
Tim

Hi,

Thank you for helping with this issue.

I exported even a simpler model that contains no hierarchy. Just one simple cylinder with 3 attributes:

tutorial.zip (2.0 KB)

Here’s a similar topic from a few years ago:

The file in this post has metadata from Artec Studio

Yes this is the same issue, but McNeel have not implemented yet.

I added this feature for OpenCascade:

But now it has to be read in rhino.

1 Like

Hi Petras,

Thank you for your effort, it is truly appreciated. But even the cylinder is a more than I need. It comes in as a brep so there are faces, surfaces, trim curves etc. I’d really like a point with one userdata on it. What I’m trying to achieve is to be able to see the geometry, userdata and the entities that connect them in a single screen.

Tim

I shouldn’t say ā€œcomes in asā€. I should ā€œexists in the file asā€. Way more than a screens worth just for the cylinder itself.

As simple as it gets, single point from OpenCascade.
A point must be part of a topological shape so I give you a smallest entity I can serialize to step the attribute is defined in line #35:


ISO-10303-21;
HEADER;
FILE_DESCRIPTION(('Open CASCADE Model'),'2;1');
FILE_NAME('Open CASCADE Shape Model','2025-07-24T16:03:05',('Author'),(
    'Open CASCADE'),'Open CASCADE STEP processor 8.0','Open CASCADE 8.0'
  ,'Unknown');
FILE_SCHEMA(('AUTOMOTIVE_DESIGN { 1 0 10303 214 1 1 1 1 }'));
ENDSEC;
DATA;
#1 = APPLICATION_PROTOCOL_DEFINITION('international standard',
  'automotive_design',2000,#2);
#2 = APPLICATION_CONTEXT(
  'core data for automotive mechanical design processes');
#3 = SHAPE_DEFINITION_REPRESENTATION(#4,#10);
#4 = PRODUCT_DEFINITION_SHAPE('','',#5);
#5 = PRODUCT_DEFINITION('design','',#6,#9);
#6 = PRODUCT_DEFINITION_FORMATION('','',#7);
#7 = PRODUCT('MyPoint','MyPoint','',(#8));
#8 = PRODUCT_CONTEXT('',#2,'mechanical');
#9 = PRODUCT_DEFINITION_CONTEXT('part definition',#2,'design');
#10 = GEOMETRICALLY_BOUNDED_WIREFRAME_SHAPE_REPRESENTATION('',(#11,#15),
  #17);
#11 = AXIS2_PLACEMENT_3D('',#12,#13,#14);
#12 = CARTESIAN_POINT('',(0.,0.,0.));
#13 = DIRECTION('',(0.,0.,1.));
#14 = DIRECTION('',(1.,0.,-0.));
#15 = GEOMETRIC_CURVE_SET('',(#16));
#16 = CARTESIAN_POINT('',(1.,2.,3.));
#17 = ( GEOMETRIC_REPRESENTATION_CONTEXT(3) 
GLOBAL_UNCERTAINTY_ASSIGNED_CONTEXT((#21)) GLOBAL_UNIT_ASSIGNED_CONTEXT(
(#18,#19,#20)) REPRESENTATION_CONTEXT('Context #1',
  '3D Context with UNIT and UNCERTAINTY') );
#18 = ( LENGTH_UNIT() NAMED_UNIT(*) SI_UNIT(.MILLI.,.METRE.) );
#19 = ( NAMED_UNIT(*) PLANE_ANGLE_UNIT() SI_UNIT($,.RADIAN.) );
#20 = ( NAMED_UNIT(*) SI_UNIT($,.STERADIAN.) SOLID_ANGLE_UNIT() );
#21 = UNCERTAINTY_MEASURE_WITH_UNIT(LENGTH_MEASURE(1.E-07),#18,
  'distance_accuracy_value','confusion accuracy');
#22 = PRODUCT_RELATED_PRODUCT_CATEGORY('part',$,(#7));
#23 = MECHANICAL_DESIGN_GEOMETRIC_PRESENTATION_REPRESENTATION('',(#24),
  #17);
#24 = STYLED_ITEM('color',(#25),#15);
#25 = PRESENTATION_STYLE_ASSIGNMENT((#26));
#26 = SURFACE_STYLE_USAGE(.BOTH.,#27);
#27 = SURFACE_SIDE_STYLE('',(#28));
#28 = SURFACE_STYLE_FILL_AREA(#29);
#29 = FILL_AREA_STYLE('',(#30));
#30 = FILL_AREA_STYLE_COLOUR('',#31);
#31 = DRAUGHTING_PRE_DEFINED_COLOUR('green');
#32 = PROPERTY_DEFINITION('my_attribute_for_Tim',$,#5);
#33 = PROPERTY_DEFINITION_REPRESENTATION(#32,#34);
#34 = REPRESENTATION('my_attribute_for_Tim',(#35),#17);
#35 = DESCRIPTIVE_REPRESENTATION_ITEM('my_attribute_for_Tim',
  'as_small_as_it_gets');
ENDSEC;
END-ISO-10303-21;

That is fanfrickentastic. Exactly what I wanted. Thank you.

2 Likes

Just a heads up. Even with the super simple step file I’m having a hard time figuring out how to get at the DESCRIPTIVE_REPRESENTATION_ITEM in code. I no longer have access to sample code either. All I have to work with is the plugins we currently have and StepTools’ header files.

I would not expect anything soon. Sorry I don’t have better news.

Tim

Hi Tim,
any news on this side?
I’ve a client that need to export multiple attributes to another platform and Step seems the way to do this.

Hi skysurfer,

Sorry, I couldn’t figure it out. So, no new news.

Tim

I did a pull request to OpenCanscade, which is now merged. Now you can now write and read step with attributes. For sure it is not rhino but technically you could write a converter from Rhino Brep to OpenCascade Brep.

I am wondering even if rhino step format was implemented from scratch or started from existing code somewhere as it is a big thing to write.

You mean that using OpenCascade I can add the metadata to a STEP file?
Also if this not happen directly in Rhino it could be a temporary solution.

Yes it can, I added that option and it is already merged: 0033896 - STEP Write - General Attributes by petrasvestartas Ā· Pull Request #634 Ā· Open-Cascade-SAS/OCCT Ā· GitHub

1 Like