fix: pull assembly dependencies recursively before opening #19

Merged
forbes merged 1 commits from fix/pull-assembly-dependencies into main 2026-02-11 19:12:23 +00:00
Owner

When pulling an assembly from Silo, linked component files were not downloaded, causing FreeCAD to report Link not restored errors for every external reference (e.g. ../X01_machined_part/X01-0004_EXTRUDER_MOUNTING_BLOCK.FCStd).

Changes

  • Add _pull_dependencies(part_number, progress_callback) helper that:

    • Queries the BOM API (get_bom()) to discover child part numbers
    • Downloads the latest file revision for each child not already present locally
    • Recurses into sub-assemblies so nested dependencies are also resolved
    • Skips children that have no file on the server (database-only items)
  • Modify Silo_Pull.Activated() to call _pull_dependencies() after downloading the assembly file and before opening it, so all PropertyXLink paths resolve correctly.

Testing

  1. Pull an assembly with BOM entries pointing to component parts
  2. Verify component files are downloaded to ~/projects/cad/{category}/ before the assembly opens
  3. Verify no 'Link not restored' errors in the console
  4. Verify pulling a plain part still works without BOM resolution
  5. Verify already-existing local files are not re-downloaded
When pulling an assembly from Silo, linked component files were not downloaded, causing FreeCAD to report **Link not restored** errors for every external reference (e.g. `../X01_machined_part/X01-0004_EXTRUDER_MOUNTING_BLOCK.FCStd`). ## Changes - Add `_pull_dependencies(part_number, progress_callback)` helper that: - Queries the BOM API (`get_bom()`) to discover child part numbers - Downloads the latest file revision for each child not already present locally - Recurses into sub-assemblies so nested dependencies are also resolved - Skips children that have no file on the server (database-only items) - Modify `Silo_Pull.Activated()` to call `_pull_dependencies()` after downloading the assembly file and before opening it, so all `PropertyXLink` paths resolve correctly. ## Testing 1. Pull an assembly with BOM entries pointing to component parts 2. Verify component files are downloaded to `~/projects/cad/{category}/` before the assembly opens 3. Verify no 'Link not restored' errors in the console 4. Verify pulling a plain part still works without BOM resolution 5. Verify already-existing local files are not re-downloaded
forbes added 1 commit 2026-02-11 19:10:57 +00:00
When pulling an assembly from Silo, the linked component files were not
downloaded, causing FreeCAD to report 'Link not restored' errors for
every external reference.

Add _pull_dependencies() that queries the BOM API to discover child
part numbers, then downloads the latest file revision for each child
that doesn't already exist locally. Recurses into sub-assemblies.

Silo_Pull.Activated() now calls _pull_dependencies() after downloading
the assembly file and before opening it, so all PropertyXLink paths
resolve correctly.
forbes merged commit 069bb7a552 into main 2026-02-11 19:12:23 +00:00
forbes deleted branch fix/pull-assembly-dependencies 2026-02-11 19:12:23 +00:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: kindred/silo-mod#19