build_variant_family
Create a set of part configurations by modifying a single dimension across multiple variant values, with optional parent configuration and final activation.
Instructions
Crear una familia de configuraciones cambiando una sola dimensión.
Junior workflow: "crea las configuraciones Corto/Mediano/Largo con longitudes 80/120/160mm". Composes (create_config + activate + modify_dimension) once per variant + a single save at the end.
Args:
feature_name: Name of the feature carrying the dimension (e.g.
"Saliente-Extruir1"). Must exist in the active part.
dimension_name: Name of the dimension on that feature (e.g. "D1").
Must exist in the feature's dimensions dict.
variants: Mapping from configuration name → new dimension value
(mm). Non-empty, all values > 0.
parent_config: Parent configuration for the new variants (empty =
root). Same value passed to create_configuration for each.
activate_at_end: Optional name of the variant to activate after
creation. None = leave the active config wherever it landed
after the loop. Must be a key of variants if provided.
Returns: {"created": [variant names in iteration order], "active_at_end": name | None}.
Caveat: If the loop fails partway through (e.g. modify_dimension raises on variant #2), the part is left with the configurations that were created up to that point. v1 surfaces the error with partial- state info so the user can manually delete_configuration to clean up. Auto-rollback isn't attempted (deletion is deferred by design per CLAUDE.md).
Example — 3-variant length family: build_variant_family( "Saliente-Extruir1", "D1", {"Corto": 80.0, "Mediano": 120.0, "Largo": 160.0}, activate_at_end="Mediano", )
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| variants | Yes | ||
| feature_name | Yes | ||
| parent_config | No | ||
| dimension_name | Yes | ||
| activate_at_end | No |