The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
 All Forums
 Origin Forum for Programming
 LabTalk Forum
 User Trees

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
Drbobshepherd Posted - 02/02/2012 : 6:26:43 PM
I am having difficulty programaticly adding a tree to a worksheet. I keep trying the examples in the Help File, "Accessing Metadata", but the trees do not appear in the page Organizer. However, if I use the Organizer to create the trees manually, I can dump them to the Command space with a "wks.tree.=;" command, but only if the proper worksheet is active.

Is this section of the Help File article wrong? I want to add a User Tree to a worksheet without having to make it active. More important, I want to access the data without making the sheet active.

DrBobShepherd

Origin Ver. and Service Release (Select Help-->About Origin):
Operating System:
4   L A T E S T    R E P L I E S    (Newest First)
AKazak Posted - 09/02/2020 : 1:23:41 PM
OriginPro 2021 (64-bit) Beta 4 9.8.0.138
Windows 7 Pro x64 SP1

To add a node we use:
wks.tree.add(NodeName)


How do we set a node type (Numeric, Text or Branch) or delete it?
Thank you.

---
Andrey
Sophy Posted - 02/05/2012 : 9:45:45 PM
Hi DrBobShepherd,

I am sorry that currently there is no way to do that in Labtalk, but you can write a simple Origin C function(in Origin C we provide full control of the storage in Organizer) to access any tree branch in the Organizer.
Drbobshepherd Posted - 02/03/2012 : 11:50:01 AM
Penn,

I tried the example and had a little success. I found I could only see the new tree by closing and then re-opening the Organizer.

I guess I still do not understand trees very welll. What does the "rr!wks.tree.add(input)" line do? The "INPUT" branch does not appear until the next line,"rr!wks.tree.input.bb = 0" is executed. In fact, this line seems to work just as well without the previous command.

What I really want to know is how can I add empty branches to the USER TREE branch of a particular worksheet using LabTalk script? Do I have to add leaves and then delete them?

My ultimate goal is to copy header variable data into the user tree of a worksheet. My plan is:
1. Use the impinfo X-function to create a tree (Let's call it "ProjectTree1") contaning the header info.
2.Create an empty tree branch in the worksheet user tree.
3.Copy the header data and structure from ProjectTree1 to the empty worksheet branch using the assignment(=)command.

So far, I have not been able to get past Step 2.

DrBobShepherd
Penn Posted - 02/02/2012 : 9:58:34 PM
Hi DrBobShepherd,

Do you mean this example, right? I have tried this example, it works, and the trees also appear in the Organizer, you can see the following image.



You can use the range to define the non-active worksheet. For example:

range rr = [book2]sheet2!;
rr!wks.tree.add(input);
rr!wks.tree.input.bb = 0;


Penn

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000