Custom TypeScript Speckle Connector

i think we’re starting to need a link to the raw deal, to understand what’s what… there might be a subtle difference or fuckup somewhere. Your collection of nodes - does it have a closure table?

you’re also getting confused (by us, apologies) with the structure from revit. site in there is essentially a dynamic prop on the root commit object - we’re changing all this in dui3 to be more sane.

rootObj["@site"] = List of things

the closure is on the rootObj. In your case, it needs to be present as well on the “Dandas Nodes” collection…

Here is the link: Viewer - dandas2 - Speckle

okay - basically the __closure table needs to incorporate references to not just the immediate children, but all leaf nodes under the respective object.

from what i see the root collection only has one id in there, which is wrong. There’s some other warning sings in there, ie @elements is supposed to be an array of object references, but i think it’s an object (and the 0, 1, 2, 3 etc. are actually object keys - it has an id property)

tl;dr i’d need to look at the serialisation code. it’s probably not doing what you’re expecting it to do; i won’t have time right now unfortunately :grimacing:

can we get our hands on reproducing this from a repo somewhere?

PS: did the hackaton start early and nobody told me :sweat_smile:

I didn’t change the BaseObjectSerializer besides adding the few lines for handling detachable objects and updating some types. So I don’t know about the closures :person_shrugging:

The @elements property is created as an array (see above), so it must be changed during the serialization.

I can create a reproducible repo for you - give me a minute.

Not part of the hackathon - just plain old ‘building cool things on top of Speckle’ :sweat_smile:

1 Like

Alright got a repo for you to play with: GitHub - ocni-dtu/speckle-custom-connector

1 Like

Viewer - dandas - Speckle :confetti_ball:

tl;dr: the excel-derived serializer that you were using is not correct. I’ve plugged in an older one (from sketchup), and we have achieved success :slight_smile:

I’ll cleanup and push code your way.

(note, i’ve enlarged by 100x your geometry to make it visible easier in the browser)

4 Likes

Awesome @dimitrie, thanks a lot!! :star_struck:

3 Likes
1 Like

A post was split to a new topic: Should I serialize my custom JSON when sending to Speckle