18 Beyond Edition 2
What the 2016 edition of the file format added — anchors, external references, signatures, and a container — and the other ways the same data can be serialised.
Every file in this book declares '2;1', which says it uses nothing beyond what edition 1 of Part 21 defined. That is true of essentially all the STEP files in existence, whatever edition the writer worked from. The third edition, published in 2016, kept everything and added UTF-8 encoding and a set of optional features, all aimed at the same problem: a Part 21 file is an island. Its instance names mean nothing outside it, it cannot refer to anything in another file, and it cannot be split.
18.1 What edition 3 adds
UTF-8. Edition 2 strings were nominally 8-bit ISO 8859 with escape sequences for anything else; edition 3 makes UTF-8 the native encoding. Most writers had already switched. A file declaring '4;1' may contain 'Ångström' directly; a file declaring '2;1' or '3;1' must escape every character above ASCII, as '\X2\00C5\X0\ngstr\X2\00F6\X0\m', and usually does not. Writers that emit UTF-8 while still declaring '2;1' are common, and are strictly wrong.
Anchors. A new optional section between HEADER and DATA gives stable names to instances:
ANCHOR;
<clamp> = #5;
<bracket> = #35;
ENDSEC;An anchor is a name in angle brackets bound to an instance. Instance names are file-local and change whenever a file is rewritten; anchors are the file’s public interface, and a URI of the form clamp.stp#bracket means “the instance that file calls bracket” regardless of what number it has today.
References. The mirror of anchors: a section that declares instance names whose definitions are elsewhere.
REFERENCE;
#35 = <bracket.stp#bracket>;
#243 = <pin.stp#pin>;
ENDSEC;Inside this file, #35 and #243 may be used like any other instance — a NEXT_ can name #35 as its child — but they are not defined here. They resolve to anchors in other files. This is how an assembly can be one file per part with a master file holding only the structure, which is how every PDM system wants to store it and what edition 2 could not express without the workaround described below.
Signatures. An optional trailing section carrying a digital signature over the file’s contents, for provenance.
A container. Edition 3 also defines a ZIP archive holding the exchange structure together with the files it references, so that a multi-file assembly can travel as one object. The standard requires the archive’s root file to be named ISO-10303.p21. In practice the CAx-IF conventions are what implementations follow: .stpZ for a single compressed Part 21 file and .stpA for a multi-file archive, whose root files are named in an stpa.ini at the top of the archive.
A file using any of these declares '4;1', '4;2' or '4;3' in FILE_ — class 2 if it has a reference section or a multi-file ZIP archive, class 3 if it defines value instances, references EXPRESS constants or carries ECMAScript — and the header gains an optional SCHEMA_ record that lists the external files whose data completes this one.
18.2 How much of this is in use
Less than one might expect, a decade on. Anchors and references are supported by some PDM-oriented exporters and by the major toolkits, but the CAx Implementor Forum’s recommended practice for external references is still the edition 2 mechanism described below, and it has not been revised since 2014. But the overwhelming majority of files exchanged between CAD systems are still single, self-contained files that use nothing edition 3 added, because that is what every reader accepts and because the AP242 XML described below took over much of the multi-file use case. A reader that does not implement edition 3 will meet files it cannot read; a reader that implements it will use the capability rarely.
18.3 The edition 2 workaround for external files
Before anchors, a master file referred to a part in another file through the document entities of Part 41 and the AP’s own file-reference extensions to them:
#900 = DOCUMENT_FILE('bracket','',$,#901,'',$);
#901 = DOCUMENT_TYPE('geometry');
#902 = DOCUMENT_REPRESENTATION_TYPE('digital',#900);
#903 = APPLIED_DOCUMENT_REFERENCE(#900,'',(#35));
#904 = IDENTIFICATION_ROLE('external document id and location',$);
#905 = APPLIED_EXTERNAL_IDENTIFICATION_ASSIGNMENT('bracket.stp',#904,#906,(#900));
#906 = EXTERNAL_SOURCE(IDENTIFIER('./parts/'));Referred to above: 6 records from clamp.step
#2 = APPLICATION_CONTEXT(
'core data for automotive mechanical design processes');
#35 = PRODUCT_DEFINITION('design','',#36,#39);
#36 = PRODUCT_DEFINITION_FORMATION('','',#37);
#37 = PRODUCT('bracket','bracket','',(#38));
#38 = PRODUCT_CONTEXT('',#2,'mechanical');
#39 = PRODUCT_DEFINITION_CONTEXT('part definition',#2,'design');A DOCUMENT_ stands for the external file (six parameters, because it is both a document and a characterized_, flattened), and an APPLIED_ attaches it to the product definition whose geometry it contains. The DOCUMENT_ is not decoration: a rule on document_ requires exactly one, naming 'digital' or 'physical'. The document type is free text; 'geometry' is what the recommended practice uses for an external shape file. There is a DOCUMENT_ as well, but only when the document itself is managed as a product, which CAD exporters do not do. The master file carries the product chains and NAUOs for the whole assembly and no geometry; each part file carries one product and its shape. The filename travels on an APPLIED_ attached to the DOCUMENT_, and the directory on the EXTERNAL_ it names. The IDENTIFICATION_ is what says the assignment carries a filename and location rather than some other identifier, and the recommended practice fixes its name as 'external document id and location'. The document’s own id often repeats the filename — here it is only 'bracket' — and a reader falls back to it when the assignment is absent. There is no anchor, so the reader must then find the right PRODUCT_ in the external file by matching product.id, product_ and product_. This is fragile and it is what AP214 multi-file exports actually did.
18.4 Other encodings
Part 21 is one serialisation of an EXPRESS population. The standard defines others, and two are in use.
Part 28: XML. Any EXPRESS schema maps to an XML schema and any Part 21 file to an XML document, mechanically: each instance becomes an element named for its entity, attributes become child elements or attributes, references become ID/IDREF. The result is several times larger than Part 21 and no more readable. It is not used for CAD geometry.
The AP242 XML business object model. AP242 defines, alongside its EXPRESS schema, a separate XML schema for the product data management half of its scope: product structure, versions, effectivity, documents, properties, external geometry references. An AP242 XML file describes an assembly’s structure and points to Part 21 files for the parts’ shapes. This is the form PDM system integrations use, and it is why anchors and references are less needed than they might have been: the multi-file case moved to XML.
Part 26: binary. A mapping of EXPRESS populations to HDF5, for very large datasets. Defined, implemented in a few toolkits, essentially unused in mechanical exchange.
JSON encodings have been proposed and prototyped by several groups; none is part of the standard as this is written.
18.5 The shape of things
A reader coming from other formats often expects STEP to evolve toward something lighter — binary geometry, a compact mesh format, a modern schema language. It has not, and the reasons are instructive. The verbosity of Part 21 is the price of being self-describing and hand-readable, which is what has kept thirty-year-old files usable. The generality of the integrated resources is the price of one standard serving shipbuilding and aerospace and electronics, which is what has kept the vendors at the table. What has changed is at the edges: AP242 added tessellation so that STEP could carry the lightweight form other formats specialise in; edition 3 added the multi-file machinery; the XML business model gave PDM systems the interface they wanted. The core — the Part 21 file, the EXPRESS schema, the B-rep in Part 42 — is the same as it was in 1994, and a reader that understands the block file in Appendix A will understand the files being written in 2040.
Edition 3 (2016) adds UTF-8, an ANCHOR section naming instances for external use, a REFERENCE section importing instances from other files by URI, a trailing signature section, and a ZIP container; a file using them declares '4;1' or higher. Edition 2 files refer to external parts by filename, carried on an identification assignment attached to a DOCUMENT_. The AP242 XML business object model carries product structure for PDM with geometry left in Part 21; Part 28 XML and Part 26 binary exist and are little used.