Hi all!
I am trying to write a simple streamlit app to extract certain nested parameters
I am working with the following Speckle model:
https://speckle.xyz/projects/dfdc0d2b01/models/60d4b65b7b
The structural engineer has nested (in a rather convoluted and inconsistent way) some key parameters I need to extract, under the “Tekla Common” and “Tekla Quantity” categories/fields. To make things more interesting (:D) NOT all elements have these parameters.
I had a go both with Grasshopper speckle plugin and with a python streamlit app. The latter shows more potential, however what it does NOT seem able to do is to find all object IDs associated with this model/commit?
I have coded this with substantial help from chatgpt, and despite being able to figure out exactly the path to each of the parameters I am after, by visually examining a full json dump of the data, the script does not seem to be able to loop through all objects IDs.
Following a long trial and error process, chatGPT concluded that:
"
✅ Speckle’s GraphQL API →
you cannot recursively call get_object_data for child IDs
that you don’t first discover through the API.
Why?
Because Speckle only stores one main graph per commit, and:
orphaned or parallel objects
objects not wired under referencedObject → elements → child → elements
are not discoverable from the API without already knowing their IDs."
" The GraphQL API only exposes linked objects via `.referencedObject → elements`, but I need a backend export or full object list for the entire commit or model."
It does suggest to find a way to get object IDs (including orphaned or unlinked objects) for downstream processing.
Is any of you able to help?