Goal
Resolve proxies at the root of connector-published data to group elements by level, material, or instance — common when reporting on Revit or Rhino connector output.When to use this
AfterReceive2 on connector data, when you need elements grouped by level or category via proxy collections rather than tree hierarchy alone.
Recommended approach
Flatten()and index byapplicationId— see Find objects by property- Read proxy collections from the root (
groupProxies,colorProxies, etc.) - Resolve each proxy’s
objectslist against the index
DataObject graphs and let connectors produce proxies.
Prerequisites
Proxy Types in Speckle.Sdk
Proxy classes implementIProxyCollection, which requires an objects list of source application IDs:
Additional proxy types (materials, levels, instance definitions) follow the same pattern. Exact shapes: Proxy Schemas.
As a producer: you typically do not create proxies when publishing from a script or service — send your
Base/DataObject graph and let connectors produce proxy collections from host-app organization.Complete Example
Step-by-Step Explanation
Resolving Simple Proxies (Group, Color)
Every built-in proxy type implementsIProxyCollection. Resolution is three steps: index by applicationId, look up each id in the proxy’s objects list, pair resolved objects with proxy metadata.
Resolving Instance Definitions
Instances are two-hop: anInstanceProxy references an InstanceDefinitionProxy by definitionId, and the definition’s objects list holds geometry application IDs.
instance.transform is a Speckle.DoubleNumerics.Matrix4x4 — apply it to place each instance correctly.
Prefer root-level property lookup (
receivedData["instanceDefinitionProxies"]) when you know the sender’s convention; fall back to Flatten().OfType<...>() when you don’t.Common Pitfalls
Proxy collection property not found on the root object
Proxy collection property not found on the root object
Root-level property names (
groupProxies, colorProxies, etc.) are a sender convention. Check Proxy Schemas or the sending connector’s documentation.InstanceProxy resolved to the wrong object
InstanceProxy resolved to the wrong object
InstanceProxy.definitionId matches an InstanceDefinitionProxy.applicationId, not id. Index definitions by applicationId.Rebuilding the applicationId index per proxy
Rebuilding the applicationId index per proxy
Build it once per received graph — see Find objects by property.
Nested instances
Nested instances
A definition’s
objects list can contain another InstanceProxy. Resolve and compose transforms recursively, multiplying matrices from outermost to innermost.Next Steps
Objects and Traversal
Base graph structure proxies attach to
Find objects by property
applicationId index pattern
Client API
Receive connector data via IClient