[Otázka] Node Group items by ID [Vyřešeno]

Tagy:
  • Allplan
  • 2022
  • Visual
  • Scripting
  • Node

Hello everyone,

I have a question:

I want to create sublists of different ID's. I use exactly the same excel file for the ReadPoints node as for the ReadTable node. The csv is sorted by ID number and sublists are created, but this does not work with the ReadTable node and then GroupitemsByID node.

Can someone tell me what I'm doing wrong and still can get my excel grouped by ID?

Přílohy (3)

Type: image/png
Staženo 44
Size: 5,34 KiB
Type: image/png
Staženo 41
Size: 42,84 KiB
Type: image/png
Staženo 50
Size: 36,11 KiB

Show solution Hide solution

To use the Node GroupItemsByID, you have to prepare two lists. One list for IDs, another one for the items to be grouped. It will rearrange the item list based on its ID accordingly. Currently, it won't work, if both lists have different size.


This is how it works:
Let's assume you have one ID list:
0 A
1 B
2 B

And one list to be grouped:

0 Point0
1 Point1
2 Point2

You will get a 2-d list as a result:

0 ## for ID = A
└─0 Point0
1 ## for ID = B
├─0 Point1
└─1 Point2

Check the attachted screenshot for better understanding.

Product Owner API, Allplan GmbH

Přílohy (1)

Type: image/png
Staženo 97
Size: 143,13 KiB

To use the Node GroupItemsByID, you have to prepare two lists. One list for IDs, another one for the items to be grouped. It will rearrange the item list based on its ID accordingly. Currently, it won't work, if both lists have different size.


This is how it works:
Let's assume you have one ID list:
0 A
1 B
2 B

And one list to be grouped:

0 Point0
1 Point1
2 Point2

You will get a 2-d list as a result:

0 ## for ID = A
└─0 Point0
1 ## for ID = B
├─0 Point1
└─1 Point2

Check the attachted screenshot for better understanding.

Product Owner API, Allplan GmbH

Přílohy (1)

Type: image/png
Staženo 97
Size: 143,13 KiB

Thank you, it works!