Extend keys component mixes values

what am i missing?, keys, values are mixed and assigned wrong.

Hi @vladimir.ondejcik!

The Extend Speckle Object by Key Value has some weird data matching logic (made by me so I’m to blame here…) which is caused by the fact that, for each object you want to extend, you can provide more than one key/value, and the values could be items or lists…

We normally don’t recommend using this one unless you’re trying to generate dynamically a new bunch of key/values that are different per object (not just the values, but also the keys).

In your particular example, you’re adding the same keys on all objects, so I’d suggest using the Extend Speckle Object node, which has dynamic inputs and will behave as expected :point_down:t3:

As for the Extend speckle object by key value. For each object you want to extend there must be:

  • Each object must be in it’s own branch
  • A list of keys in the same dataPath as the object is in
  • A set of value/s for each key, which should be in a dataPath that contains an extra number at the end representing the index of the key in the keys input.

I’m currently quite busy with the new release we’re testing, but I’ll try to come up with an example file for how to use the Key Value one sometime this week.

Meanwhile, I hope the Extend Speckle Object node would do the trick for you :wink:

2 Likes

thank you for help, i will test your instructions

1 Like

Hi again, this should match your path description, but still wrong result

Hi @AlanRynne!

I’m also struggling with this topic. Both with the ESO K/V and the ordinary K/V Speckle components behave very weirdly.

The way you describe that these components should work, i.e.

  • each object must be in it’s own branch,
  • a list of keys in the same dataPath as the object is in,
  • a set of value/s for each key, which should be in a dataPath that contains an extra number at the end representing the index of the key in the keys input,

makes total sense to me, but that is not how these components behave.

In the script linked to this post I divide a surface and restructure the data tree such that the first path index represents the row and the second path index represents the column in which each point is located. I then created a Point ID’s for each point which I then wanted to assign to the point geometry in a Speckle object, but struggled a lot with the K/V Speckle component.

I extensively investigated the behavior of the K/V Speckle component and made the following observations:

  1. Without renumbering the Data Tree Paths the K/V Speckle component doesn’t work at all.
  2. When renumbering the paths the data in the values on the left of the K/V component (see data viewer) doesn’t match the data in the e.g. Point ID key of the created Speckle objects, see red panel. I’d say the data in the red panel should have been as the data in the green panel (created using the normal CSO component)
  3. There are duplicate Point ID’s all of a sudden. That should ofc not be possible.

¿What The Heck?
This is the weirdest thing of all: when you reconnect one of the Renumber Paths components to the K/V component, the content of the red panel changes. That mean that the K/V component doesn’t always return the same output given the same input. Very strange…

I’m looking forward to your reply @AlanRynne!

Session 04 Speckle.gh (24.5 KB)
Speckle stream

3 Likes

Hi @JoostGevaert,

this is… concerning! WTH indeed… :exploding_head:
I’ll have a look tomorrow first thing and try to wrap my head around and hopefully get back to you with some answers.

Thanks for reporting this in such detail, and including files! I’m sure it will be most helpful to reproduce :wink:

2 Likes