Skip to main content
Now that you understand the data model, here are practical patterns for traversing and processing Speckle models. These recipes assume you have a Root Collection object.

Recipe 1: Traverse Collections and Objects

The most common pattern: walk the collection hierarchy to find all objects.

Recipe 2: Find All DataObjects

Filter for DataObjects specifically:

Recipe 3: Process Geometry from displayValue

Extract and process geometry from DataObjects:

Recipe 4: Resolve Proxy References

Find which objects use a specific resource:

Recipe 5: Find Resources for an Object

Find which resources (materials, groups, etc.) an object uses:

Recipe 6: Resolve Instance Definitions

Get geometry for instance objects:

Recipe 7: Build Object-Resource Map

Create a lookup map for efficient access:

Recipe 8: Filter by Properties

Find objects matching specific property criteria:

Recipe 9: Process by Collection Path

Process objects organized by their collection hierarchy:

Recipe 10: Extract Model Statistics

Gather statistics about a model:

Common Patterns Summary

  1. Always check for attributes - Use hasattr() before accessing properties
  2. Handle empty arrays - displayValue and objects may be empty
  3. Use applicationId for references - Proxies reference by applicationId, not id
  4. Recurse collections - Collections can be nested to any depth
  5. Check speckle_type - Use speckle_type to identify object types
  6. Proxies are at root - Always look for proxies in Root Collection
  7. Geometry in displayValue - All DataObject geometry is in displayValue

Next Steps

Last modified on July 18, 2026