LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Exporting All Tree Control Item names to array

Solved!
Go to solution

I want to export all my tree control's items to a 2D array of strings so I can use the data in another application.  How do I do this programmatically?  Do I have to iterate on items or is there some easy trick?

0 Kudos
Message 1 of 16
(5,035 Views)

So MGI has a few tools that make going in the reverse a little easier.  They have a function that takes a 2D array of string, and turns it into a tree, but they don't have a function that goes in reverse.

 

For you to do this you will need to iterate over all parents getting their children.  But MGI does have a function that might help with this, and it gives you all children for a parent.  Throw that in a while loop and a few shift registers and you should be able to go from a tree to a 2D array of string.

0 Kudos
Message 2 of 16
(5,022 Views)

Where do I go to get MGI VIs?

0 Kudos
Message 3 of 16
(4,980 Views)

http://sine.ni.com/nips/cds/view/p/lang/en/nid/209753

 

Install VIPM, and it should show up in the list.  Install the MGI Tree.

0 Kudos
Message 4 of 16
(4,976 Views)
Solution
Accepted by topic author id

Thanks, I suppose I will thus have to parse thru the tree control with a complex program also.

0 Kudos
Message 5 of 16
(4,915 Views)

>>> Install VIPM, and it should show up in the list.  Install the MGI Tree.

 

Honestly,

It doesn't look very reasonable to waste time downloading and installing over 100Mb of unnecessary stuff just to see <10Kb file.

0 Kudos
Message 6 of 16
(4,426 Views)

All required MGI and OpenG dependencies are 15MB, and if I'm being honest there are so many useful code utilities in OpenG and MGI that I'd be willing to wast 100MB of space for it if it really was that large.  Hard drive space is cheap, what is expensive is time and MGI and OpenG has many years of refinement and features.

0 Kudos
Message 7 of 16
(4,420 Views)

Still installing.....

I don't need those "useful code" at all. What I need - just a single file with the example.

Please consider this as a kind of "Customer's feedback".

 

0 Kudos
Message 8 of 16
(4,414 Views)

Here's how I would do it...the only drawback is that you have to know how many columns there are in the tree.

Untitled.png

0 Kudos
Message 9 of 16
(4,408 Views)

Hi, thanks for your replay.

This solution was the first thing came to my mind and I did pretty  similar code.tree1.jpg

 

BUT, the problem with this solution is that for the tree 50x12 size it takes around 1.5sec to execute it.

Which is absolutely unacceptable for my task as tree is a part of the GUI where the conversion should be done "on the fly" and shouldn't slow down the main loop.

So I started looking for some different ideas which may potentially work faster.

So you are welcome to share your thoughts if you have any ideas how too make the conversion faster.

 

0 Kudos
Message 10 of 16
(4,396 Views)