Browse documentation
Docs/Language

Sewing pattern interchange

seamly"...", seamly"""...""", ... and PARSESEAMLY(text) import the Seamly2D 0.7.4 pattern XML profile in Standard (Lite) and Pro. They return native Grid objects. The existing sewing tag…

Sewing pattern interchange

seamly"...", seamly"""...""", <seamly>...</seamly> and PARSE_SEAMLY(text) import the Seamly2D 0.7.4 pattern XML profile in Standard (Lite) and Pro. They return native Grid objects. The existing sewing tag remains the separate Grid-defined record contract.

The profile is pinned to upstream revision 016f3f335a8516906161971a677e50e0040e3be8. Other Seamly/Valentina versions, measurement-file formats and pattern archives are not covered by this reader.

The result contains ordered draftBlocks, objects, pieces, variables, resources, references, nodes, edges and raw elements. Object IDs are global unsigned integers; alternate numeric spellings have the same identity. Piece boundaries retain their authored order, seam allowances, notch attributes and grainline declarations. Units are mm, cm or inch.

Operation destination IDs and the two point IDs of a trueDarts tool define generated objects. Source IDs reference existing objects. Graph identities use seamly:object:<id>, with separate XML element nodes and explicit containment, reference and generated-point edges. A moving operation's zero center is retained as an automatic-origin declaration, without inventing a point or graph edge. Other unresolved references produce warnings and retain their source records; unresolved edges are omitted. Duplicate identities are errors.

pattern = <seamly><pattern><version>0.7.4</version><unit>cm</unit>
<measurements/>
<draftBlock name="Panel"><calculation>
<point id="1" type="single" name="A" x="0" y="0"/>
</calculation><modeling/><pieces/></draftBlock>
</pattern></seamly>
object_count = ROWS(pattern.objects)

Construct the graph with an inline literal, for example graph construction = GRAPH(<seamly>...</seamly>). Named native-data bindings are not yet supported as live graph sources; treating them as fixed snapshots would lose later overrides. The maintained example includes the inline form.

Import preserves formula strings and external measurement filenames. It does not evaluate formulas, retrieve resources, derive generated coordinates, construct geometry, render layouts or export patterns. formulasEvaluated and geometryConstructed are false. Numeric coordinates explicitly present in the source must be finite. This is structural import, not full XSD validation or a pattern-construction engine.

Editor integration includes tag help, raw triple/angle XML highlighting and diagnostics through an injected native parser binding. Escaped ordinary strings retain Grid string highlighting. Reference navigation, highlights and identity hover use local numeric object IDs, including generated destinations and trueDarts points. Alternate numeric spellings share an identity. Ambiguous duplicates, entity-encoded identities, unsupported versions and over-budget payloads refuse assistance. Formula names and external resources are not indexed. Payload completion and formatting remain unavailable; rename is refused because formulas and custom attributes may refer to names. Source and tokenizer checks do not establish rendered or packaged editor verification.

The maintained example retains a richer piece boundary and rotation declaration. See the coverage register for test and integration status.