Expand description
Step editing: merge, split, insert, reorder, nest, move a part between steps, update a step’s fields, and each step’s presentation.
Merge, split, reorder and a part’s move stay among siblings (the steps
under one parent): a group builds one thing. nest_step moves a step to
another parent, children and all. Each refusal says why.
Structs§
- AddReport
- What
add_partsdid: how many occurrences joined the step, and the ones left where they were, each with the step that holds it (or the sub-assembly it is inside). - Left
Occurrence - Presentation
- What a step shows: occurrences placed in earlier steps (drawn ghosted), those this step adds (highlighted), and those not placed yet (hidden).
Functions§
- add_
field - Add a field to
step_idatindexamong its fields (the end when absent or past it).fieldis its JSON ({label, kind, …}, seeStepField::from_json); an id it carries is ignored. Returns the new field’s id. - add_
parts - Add
components(parts of the assembly, by occurrence) tostep_id: a BOM row dragged into a step. An occurrence already in a step, or inside a sub-assembly another step places whole, is left where it is and reported, unless the target step is inside that sub-assembly’s group (a descendant of the step placing it, not that step itself: the step placing the whole never also adds one of its parts). A fastener brings its torque when the step has none. Rows coalesce as everywhere (Step::coalesce_adds). - delete_
step - Delete a step. Its parts must have moved elsewhere first, so no part is silently dropped from the instructions, and its child steps too.
- empty_
steps - Steps with nothing to do: no part to add, no steps under them (a group with parts only in its children is not empty) and no field to record (an inspection step adds no part and is still work).
- insert_
step - A new empty step right after
afteramong its siblings, or at the end of the top level. Parts come to it bymove_add. Returns its id. - merge
- Merge
step_ids(two or more siblings) into the first of them in their order, which keeps its place: adds, tools, callouts, arrows and child steps and fields are appended in order, notes joined, and the first torque and view kept. - move_
add - Move one add (by index) from
fromtoto, a sibling step. The source step may be left empty; it is then listed byempty_steps. - move_
field - Move one field to
indexamong its step’s fields (clamped to the end). - move_
step - Move
step_idtoindexamong its siblings (clamped to the end). - nest_
step - Move
step_id, children and all, underparent(None: the top level) atindexamong its new siblings (clamped to the end). Its id, and its children’s, never change. A step cannot go inside itself. - presentation
- The presentation of
step_idoveroccurrences, the occurrence paths of the drawn solids (a sub-assembly occurrence stands for every path under it). The step adds what it and its descendants add (a parent installs the group its children built); placed is what its earlier siblings, and their descendants, added; a step inside a group sees nothing of the assembly around the group. Everything else is hidden. - remove_
add - Take one add (by index) out of
step_id: the part is in no step any more (“not yet planned”,unplanned); its insertion arrows and the callouts pointing at its occurrences go with it. Returns the add. - remove_
field - Take one field off its step. Returns it.
- split
- Split the adds at
add_indicesout ofstep_idinto a new step right after it, with the arrows and callouts that point at their occurrences. Returns the new step’s id. - unplanned
- The parts of
levelnot yet in any step, top-most first: a component no step adds, itself or through an ancestor; and, inside a sub-assembly built step by step (the step placing it has child steps), a part no step adds itself (its own step lost it). A sub-assembly’s parts are not listed while the sub-assembly itself is unplanned (they come with it) nor while a step places it whole with no child steps (the whole covers them). - update_
field - Set keys of one field from a JSON patch (
StepField::patched). - update_
step - Update a step’s authored fields from a JSON patch. Keys:
title,notes,view(string or null),tools(array),torque(object or null; a set torque becomes an override),callouts,arrows,signoff,motion,fields(the whole list; one without an id takes a fresh one). Unknown keys are refused.addschange only through the edits above.