SpeckleException: Cannot set 'Brep.displayValue'

I am working on a simple Speckle importer in Python. I would like to retrieve the base object from a Rhino Speckle commit with the following code snippet:

client = SpeckleClient(host="https://speckle.xyz/")
account = get_default_account()
client.authenticate_with_token(token=account.token)
transport = ServerTransport(client=client, stream_id="########") #stream_id hardcoded for testing
commit_id = "##########" #last commit from Rhino hardcoded for testing
commit = self.client.commit.get(self.streamId, commit_id)
referenced_obj = commit.referencedObject
res = operations.receive(obj_id=referenced_obj, remote_transport=transport)

The last line gives me the following error:

SpeckleException: SpeckleException: Cannot set ‘Brep.displayValue’: it expects type ‘Mesh’, but received type ‘list’

At:
...\specklepy\objects\base.py(287): _type_check
...\specklepy\objects\base.py(203): __setattr__
...\specklepy\serialization\base_object_serializer.py(323): recompose_base
...\specklepy\serialization\base_object_serializer.py(358): handle_value
...\specklepy\serialization\base_object_serializer.py(344): <listcomp>
...\specklepy\serialization\base_object_serializer.py(344): handle_value
...\specklepy\serialization\base_object_serializer.py(323): recompose_base
...\specklepy\serialization\base_object_serializer.py(265): read_json
...\specklepy\api\operations.py(89): receive

note: I also have a simple exporter in Python. When I push a simple cube from the standalone exporter I am then able to retrieve the base object from that commit using the code above. Could you give me some pointers to help me understand the problem better?

thanks for the help in advance

I did a quick test and pushed a cube to a new stream from SketchUp Speckle. The code above worked for the SketchUp object.

hey @esek,

sorry about that, but this was a bug in specklepy :bug:! I had forgotten to merge in a change that needed to coincide with the 2.4.0 connector release. I’ve just triggered the build for specklepy 2.6.2 which will fix this issue and should be available to pip install very soon :rocket:

the change is backwards compatible so it should work with streams created before and after connector version 2.4.0

2 Likes

@izzylys thank you very much -will be on the lookout :slight_smile: