| T O P I C R E V I E W |
| irek |
Posted - 05/18/2003 : 2:19:21 PM 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! |
| 2 L A T E S T R E P L I E S (Newest First) |
| irek |
Posted - 05/19/2003 : 05:32:36 AM Thank you Mike! Everything work now. Irek |
| Mike Buess |
Posted - 05/18/2003 : 4:54:00 PM 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 |