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
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 Forum for Origin C
 update GraphObject on worksheet from OC
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

irek

Japan
14 Posts

Posted - 05/18/2003 :  2:19:21 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hi All!
I need to show some information from header of my binary file
at the top of worksheet like it works in "BinaryImport" sample.
But for my worksheets code from this sample doesn't work.
For example for Object with text in it "File Name" I am trying to do
GraphObject goName;
goName = wksData.GraphObjects("File Name");
I get:
goName - Invalid Object
Unfortunately it is impossible to see the "Label Control" properties
of all GraphObjects in ScanWks.OTW - may be here I do mistake.
Could someone explain how to reach the GraphObject on worksheet template from OC? And what kind of "Label Control" properties I should set?
Thank you in advance!

Mike Buess

USA
3037 Posts

Posted - 05/18/2003 :  4:54:00 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
The objects in ScanWks.otw are just non-selectable text labels. Their label control properties can be viewed/edited if you select Edit->Button Mode. But all you need to know are their names, which you can figure out by listing the objects to the script window (list o). The easiest way to get the label text is probably with LabTalk.Object.Property. For example, the "File Name" label is called IDFileName and you can get at its contents like this...

string goName = LabTalk.IDFileName.text$;

You'll need to get rid of the "File Name:" prefix to get the file path.

...If you want to use GraphObject then something like this will work

void test()
{
Worksheet wksData = Project.ActiveLayer();
GraphObject goFileName;
goFileName = wksData.GraphObjects("IDFileName");
out_str(goFileName.Text); // read what's already there

string strFileName = "C:\\Temp\\Temp.txt";
goFileName.Text = "\\b(File Name:) \\v( " + strFileName + ")"; // replace it with something else
}

Once again, you have to strip off the formatting to get at the file path.

Mike Buess
Origin WebRing Member

Edited by - Mike Buess on 05/18/2003 7:09:18 PM

Edited by - Mike Buess on 05/18/2003 7:10:11 PM
Go to Top of Page

irek

Japan
14 Posts

Posted - 05/19/2003 :  05:32:36 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thank you Mike!
Everything work now.
Irek
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000