Skip to content
brep-conformancegithub

write_step

Exchange · api.md § write_step · all operations

write_step(s: Solid) -> string

Writes the solid as a STEP file. Returns the file's contents, as a string.

The kernel chooses the schema, which is AP203, AP214 or AP242, and the file's header names the schema. Another reader must be able to read the file, not only the kernel that wrote it. When the suite is run with a second kernel as --peer, the suite has the second kernel read the file, and reports whether the second kernel reads the same solid.

Example. Solid 1 is a 10 × 20 × 30 mm box with one corner at the origin.

> {"cmd": "write_step", "s": 1}
< {"ok": "ISO-10303-21;\nHEADER;\n
   FILE_DESCRIPTION(('springrep solid'),'2;1');… (10,474 characters)"}

A STEP file travels as a string holding the file's contents: all of its text, from ISO-10303-21; to END-ISO-10303-21;, in the clear-text encoding of ISO 10303-21. The string is never a path or a file name, because the kernel and the suite need not share a disk. The adapter hands the kernel that text as UTF-8 bytes. The files the suite writes use only the standard's basic alphabet, which is plain ASCII.

FunctionFieldsReturns
write_stepsstring
sewtext, toleranceSolid
read_steptextSolid