12-12-2024 03:26 AM
From a SubVi I get a 2D array of string elements. Let's say it is like that:
A 1 a
A 1 b
A 2 a
A 2 c
B 1 c
B 1 a
C 1 b
C 2 c
A B a
B C a
C Z a
I would like to insert this data to a tree that in the end it would look like this:
-A:
>1
>>a
>>b
>2
>>a
>>c
>B
>>1
>>>c
>>>a
>>C
>>>1
>>>>b
>>>2
>>>>c
>>>Z
>>>>a
https://forums.ni.com/t5/LabVIEW/2D-Array-of-Strings-to-Tree-Control/m-p/3765940#M1060883
I'm stuck on how I can do this. I found simillar problem posted in 2018 but it doesn't solve A inside B inside C problem ( and what can we do when data comes not in desired oreder for egz. B>1>a then A>B>1 then C>A>1>b)
12-12-2024 05:42 AM
Hi Sacra,
@SacraMt wrote:
I would like to insert this data to a tree that in the end it would look like this:
-A:>1
>>a
>B
>>1
>>C
>>>1
What's the rule to indent C once more than A or B?
12-12-2024 06:34 AM
It is not really the rule. Point is sometimes you can get new value that will be your parent for the rest that already existed. Problem comes from this simple project of mine, i want to picture the structure of nested tabs on the tree using property nodes/scripting nodes. Depending on witch page new tab is added i want the tree to be updated when i call the function. The front panel looks like this:
And from my code i menage to extract tree that is not working properly but can somewhat picture the tab structure.
The problem is to read and show properly when there are multiple tabs within tabs etc. on the tree control and it should be updated when changes occures on those tabs. So, when i add tab C and put every already existed tabs inside and hit the button i want tree to update and show me new paths to tabs.
Hope you have some idea
Best regards,
Sacra
Here is my Vi and tested Vi: