Working with 3D lists

Schlagworte:
  • Allplan
  • 2022
  • Visual
  • Scripting
  • List

Hi everyone,

I have a question:
I would like to work with lists in my script, but now I have a problem. In Allplan visual scripting you can work with 2D lists, but now I would like to go one dimension deeper. I would like to make a 3D list.
Now I get into the problem that a lot of nodes can only reach a 2D list and not one dimension deeper. I've used some nodes to try some things and they didn't give the result I wanted, only the slice function works so far (see image). Only the slice function is to slice in half, but I would also like to slice a list more than once. After the slice funtion I want to create a 3D polyline between the 3D lists, but also the polyline node doesn't do what I want. Another node that is doesn't working is the GroupitemsbyID. I want that what the slice node does that the groupbyitemId this does for me. But instead of slicing the list by IDs, the node looks at list length and groups the list by length and not the given ID's.

Is there a possibility to work with 3D lists, without having to get every item from the list so that it becomes a 2D list or is it possible in the near future?

Anhänge (2)

Typ: image/png
79-mal heruntergeladen
Größe: 19,78 KiB
Typ: image/png
48-mal heruntergeladen
Größe: 13,72 KiB

Hello,

please give us more information about the needed workflow. Which nodes do you need for the workflow?

Maybe you can add a small sample script. Some possibilities are currently available by the list state, which can be defined for the ports of the node.

Best regards
Horst

Hello,

Here is an example file and associated excel.
The beginning is not what my script looks like, this is a slightly simplified way. But this is the workflow I want to get.

As you can see the GroupbyItem works fine for 2 1D lists, but once you put 2 2D lists in it, it doesn't work as it should. I want sublist 1 (segment 1(3Dpoints)) to be split with the sublist 1 (segment 1(floor_10,etc.)) as happens with the 2 1D lists but now he need to create a 3D list. After that the 3D list must also be used by the 3Dpolyline, front and back nodes. Like it works with the 2D list under the 3D list nodes.

Hopefully you can do something with it and if you need more explanation, I'd love to hear it.

ps. the .xlsx file doesn't upload but if you copie the data from the .txt file to a .xlsx file you can link this file to the script.
ps. is there a possibility that you can combine multiple lists in to a 2D list (like I do with the OperatorMultiplication node do).

Best regeards,

Mike

Anhänge (2)

Typ: text/xml
764-mal heruntergeladen
Größe: 37,20 KiB
Typ: text/plain
771-mal heruntergeladen
Größe: 1,52 KiB

Currently, the node GroupItemsByID doesn't support multi-dimensional list. We will try to improve that in future.

In your case, if the number of the group is not dynamic, you can try to extract every single point list and ID list from the both 2D-lists. And use GroupItemsByID on 1d-list level. And repeat that for each sub list you have in you 2D-list. But it won't work if you have dynamic number of sub lists.

I'm not sure how you generated you source table. Perhaps you can generate the point list with two IDs, one for floor level (e.g. floor_10), one for polyline level (polyline_a). And you can concatenate both IDs into one ID in VS and use that new ID to regroup all the points to generate separate polylines. That is not a perfect solution. Perhaps it will work.

To combine multiple lists into one 1D-list you can try node ListMerge.

Anyway, I hope, I understand your problem correctly...

Product Owner API, Allplan GmbH