Core Concepts
Once you’ve calledreceive_version()
, you’re now working with standard Speckle data structures. No special Speckle Automate handling is required—everything behaves just like it would in any Speckle-enabled workflow.
Speckle represents building data as a directed acyclic graph (DAG):
- Objects reference other objects but never themselves.
- Properties can be primitive (strings, numbers) or references to other objects.
- References are one-way (parent → child).
- Common structures include
elements
,parameters
,units
,applicationId
, and legacy@
prefixed properties.
Strategy Selection
When working with Speckle data, selecting the right strategy for data handling is crucial. Depending on your specific needs, you may choose from various strategies such as filtering and collection, hierarchical analysis, or model augmentation.Flattening: When You Just Need Everything in One List
Sometimes, all you need is every single object in a model—no hierarchy, no context, just a flat list of elements to work with. This is especially useful when:When to use?
- You need to apply a bulk operation across all objects (e.g., tagging, filtering).
- You’re exporting data and don’t care about parent-child relationships.
- You want to run quick queries without navigating complex nested structures.
💡 Hacker Tip: You can be a lot simpler in crafting a flatten function for Speckle data, essentially you define the logic to finding children and then recursively call the function on each child, dumping what you find into a list.
- Simple & Universal – Works on any Speckle model, regardless of complexity.
- Fast Querying – Once flattened, any filtering or analysis can be done without recursion.
- Great for Bulk Operations – Need to tag, validate, or extract properties? Just loop over the list.
Filtering and Collection: Extracting Meaningful Data
Sometimes, you don’t care about the full model structure—you just need specific objects based on criteria. This is where filtering and collection strategies come in handy.When to use?
- You need a quick inventory of elements (e.g., all beams over 10m long).
- You want to run rule-based validation (e.g., missing materials in structural elements).
💡 Hacker Tip:
- This method is blazing fast because it avoids unnecessary traversal.
- Combine multiple filters at once to cut down processing time.
Hierarchical Analysis: Understanding Model Relationships
Not all elements exist in isolation—especially in structural, MEP, or nested families workflows. Sometimes, relationships are the critical factor.When to use?
- Structural stability checks (e.g., “Does every floor have enough supporting columns?”).
- MEP system validation (e.g., “Are ducts properly supported?”).
- Logical grouping validation (e.g., “Are walls properly associated with rooms?”).
💡 Hacker Tip:
- Instead of querying the whole model (slow!), query only relevant objects.
- Add metadata (“structural_review”: “insufficient_support”) so later steps can flag these floors.
Model Augmentation: Adding Intelligence to Models
Adding custom insights to a model can be a game-changer—whether for validation, compliance, or optimization.When to use?
- You want to tag elements for review based on logic.
- You need to enrich models with additional properties for later use.