Only getting the first 10 branches in Grasshopper

Hi there,

I have a stream with a lot of branches (18 or 52 on the ones I tested), but when I use the Stream Details component I only get the firs 10 of them. I tried it both on the xyz server, and our own one. I even tried with SpecklePy, but the result is the same. Do you know how to list all of them?

Hi @reka, yes this is correct. the GH nodes use the standard API interface which does limit lists of stream data to 10. A fellow community member @cgburgos reported it and in response worked up their own node that grabs more. Extending that to allow for an input would be trivial enough.

1 Like

Hi @jonathon ,

thanks for the quick responze, I was able to solve it finally. It wasn’t an easy ride though. Could you please release a full API documentation someday?

I will include it here for anyone with the same problem.

from specklepy.api.client import SpeckleClient
from specklepy.api.credentials import get_account_from_token


#User Input boxes
speckleServer = "speckle.xyz"
speckleToken = "<YOUR_TOKEN>"

#CLIENT
client = SpeckleClient(host=speckleServer)
#Get account from Token
account = get_account_from_token(speckleToken, speckleServer)
#Authenticate
client.authenticate_with_account(account)

#Stream Branches 🌴
branches = client.branch.list(<YOUR_STREAM_ID>,100)

One more trick, for those who prefer to use python: the PythonScrypt component shipped with Grasshopper cannot use specklepy, since it uses IronPython (2.7). You have to use GH_CPython.

1 Like

Definitely, thanks for the feedback!

We will also change the default number of branches retrieved in grasshopper :slight_smile:

2 Likes