T O P I C R E V I E W |
Piasecki |
Posted - 07/23/2004 : 12:46:15 PM Is there any way of finding some graph among the many in the project using some criteria, e.g. the text in the graph title? |
30 L A T E S T R E P L I E S (Newest First) |
Piasecki |
Posted - 04/18/2007 : 07:08:01 AM There is one positive result: I did according your advice run it from the script window by entering the command run.section(Custom,Main) and it worked! However: this works only once, after running this command (or if I do "cancel") I have to open again the script window and write again the command, or to open the saved script. Second, the toolbar/button Custom still doesn't work, even if I believe that I did all in agreement with instructions contained in: http://www.originlab.com/index.aspx?s=9&pid=366
...
|
Mike Buess |
Posted - 04/17/2007 : 8:57:40 PM Sorry, but I can think of no reason for the Custom Routine button to fail other than a syntax error or if custom.ogs is in the wrong place. Please hold down the Ctrl and Shift keys and click the Custom Routine button. This will open custom.ogs in LabTalk editor. If you're using the last script in this topic then the lines below the slashes "//" should look like this...
[Main] getstring (Enter time search string...) "00:00:00" (Find); if(%B=="") return; %W=""; doc -e P { if(timestamp.show!=0/0) { %T=timestamp.text$; if("%[%T,#2]"=="%B") {%W=%H; break}; }; }; if(%W!="") win -a %W;
If that is your script and clicking the Custom Routine button still does not open a Find dialog then I can't explain what's happening. In that case you can try assigning the script to a custom toolbar as explained here...
http://www.originlab.com/index.aspx?s=9&pid=366
...Or run it from the script window by entering the command run.section(Custom,Main)
Mike Buess Origin WebRing Member
Edited by - Mike Buess on 04/17/2007 9:03:51 PM |
Piasecki |
Posted - 04/17/2007 : 4:46:28 PM I also reinstalled Origin, but this changed nothing...
|
Piasecki |
Posted - 04/17/2007 : 4:39:06 PM I started from this, of course. It looks exactly as it should be...
|
Mike Buess |
Posted - 04/17/2007 : 4:26:06 PM LabTalk scripts do not need to be compiled. You must have overwritten your Find... script with something else. Open Custom.ogs in Notepad and enter the correct script again.
Mike Buess Origin WebRing Member |
Piasecki |
Posted - 04/17/2007 : 3:06:43 PM Revisiting after 3 years: the trick worked some time but one day it stopped. Since then clicking the button "Custom" makes NOTHING. The proper custom.ogs is in the Origin directory, but somehow it doesn't work. Perhaps it should be recompiled but I am not sure whether I do it properly: I double click the custom.ogs, but what then?
|
Piasecki |
Posted - 07/30/2004 : 12:15:27 PM The main gain is in time of entering the string (and now it is less error prone).
Thanks, grazie, dziekuje! Eryk
|
Mike Buess |
Posted - 07/30/2004 : 11:43:42 AM This should work. Now the if condition is on the second token (time) of the date/time string. That will not speed up the search but the additional break statement might. It exits the doc loop when the search string is found.
[Main] getstring (Enter time search string...) "00:00:00" (Find); if(%B=="") return; %W=""; doc -e P { if(timestamp.show!=0/0) { %T=timestamp.text$; if("%[%T,#2]"=="%B") {%W=%H; break}; }; }; if(%W!="") win -a %W;
Mike Buess Origin WebRing Member |
Piasecki |
Posted - 07/30/2004 : 10:22:05 AM GREAT, that's it! This is what I looked for. Just one additional request: could you pls eliminate the date from the custom.ogs? This is quite redundant and slows down the procedure(time is quite sufficient).
Thanking in advance Eryk
|
Mike Buess |
Posted - 07/30/2004 : 09:21:43 AM It would seem that to locate a graph window from its physical printout all you need to know is the name of the graph window and the path\name of the project it's in. The new stamp button (with suggested modifications) will add text labels with both pieces of information to future graphs and their printouts. Open the project named on the printout and use Project Explorer's Find command to search for the window name.
It finally dawned on me that the 'time stamp' you've been referring to is not an internal property but a text label like the file name stamp. (I never use the Time Stamp button and forgot that it existed.) If you've been labelling your printouts with the time stamp then you can search for the graph window containing a particular date/time string.
1. Open custom.ogs in Notepad.
2 . All lines starting with // are comments. Ignoring comments and empty lines, make the file look like this...
[Main] getstring (Enter date/time search string...) "1/1/2000 00:00:00" (Find); if(%B=="") return; %W=""; doc -e P { if(timestamp.show!=0/0) { %T=timestamp.text$; if("%T"=="%B") %W=%H; }; }; if(%W!="") win -a %W;
3. Save and close Notepad.
4. Click the Custom Routine button and enter the date/time string appearing on a printout. That will bring up the window containing that time stamp if that window exists in the project.
Mike Buess Origin WebRing Member
Edited by - Mike Buess on 07/30/2004 09:40:39 AM |
Piasecki |
Posted - 07/30/2004 : 05:51:40 AM In fact I can "force" labeling the graph by time stamp: I have to rename the graph pasting the time stamp string (and - if I wish - some additional info) into the label window. Then the stamp will be searchable. This is what you have in mind? But for this, I think, all the play with the script is not necessary: I can just press the standard time stamp button, copy (by hand) the time string and paste it as the label during the rename operation. This is faisable, even if a bit cumbersome. But perhaps you have in mind some more automatic procedure? Cheers Eryk
|
Piasecki |
Posted - 07/29/2004 : 5:27:33 PM OK, it works in a sense that it adds a string (with a path and time stamp) to the graph. But does it mean that it "labels" the graph? In any case the FIND comand is not able to find the graph...
Eryk
|
easwar |
Posted - 07/29/2004 : 5:16:52 PM quote:
Suggestion to OriginLab: Since OPK is an OriginLab technology perhaps general instructions for OPK installation should be included somewhere on the File Exchange.
Hi Mike,
That is a good suggestion - we will see how to add such general info to File Exchange.
Eryk, my apologies - I did not realize that this OPK had not instructions on installation.
Easwar OriginLab
|
Mike Buess |
Posted - 07/29/2004 : 4:44:18 PM Download stamp.opk to any location on your hard drive. Start Origin and when its ready find stamp.opk in Windows Explorer and run it by double-clicking on its icon or dragging it to Origin's program window. That will automatically install the Stamp toolbar.
...Many of the add-ons on the File Exchange are installed by OPK. Most give instructions for installing but some do not (e.g., Stamp). Suggestion to OriginLab: Since OPK is an OriginLab technology perhaps general instructions for OPK installation should be included somewhere on the File Exchange.
Mike Buess Origin WebRing Member
Edited by - Mike Buess on 07/29/2004 5:04:27 PM |
Piasecki |
Posted - 07/29/2004 : 4:24:44 PM Thank you, but my question was not where from to download but rather where to put the file, into what directory. And HOW to compile it (I don't know the LabTalk!)?
Cheers Eryk
|
easwar |
Posted - 07/29/2004 : 4:12:16 PM quote:
WHERE to download and HOW to install? There is nothing like this in the help... Eryk
Hi Eryk,
File Exchange is an area of our website where users can upload and share tools/applications with others: http://www.originlab.com/FileExchange/ OriginLab often places things there to share with users as well.
The specific item Mike referred to is under the Graphing category: http://www.originlab.com/FileExchange/details.aspx?C=5&cid=5&fid=27
Easwar OriginLab
Edited by - easwar on 07/29/2004 4:12:51 PM |
Mike Buess |
Posted - 07/29/2004 : 4:11:05 PM Hi Eryk,
Just follow the link I gave above. Here it is again...
http://www.originlab.com/FileExchange/details.aspx?C=5&cid=5&fid=27
Mike Buess Origin WebRing Member |
Piasecki |
Posted - 07/29/2004 : 3:18:31 PM OK, Mike, finally I have some time to check your idea. You wrote: >Just download and install stamp.opk from OriginLab's File Exchange...
WHERE to download and HOW to install? There is nothing like this in the help... Eryk
|
Mike Buess |
Posted - 07/27/2004 : 2:40:54 PM You can put the time into the stamp label, if that's what you mean...
label -s -sa -d (.1*page.width) (.05*page.height) -n pathstamp \v(%x%g - %H - $(@D,D10)); pathstamp.fsize=16;
The last statement reduces the font size to 16 pts because your stamp label might be getting pretty long by now. :)
...The date/time in the label will be the date/time that you created the label (clicked the stamp button) and not the time you created the graph. Practically the same thing for cataloging purposes.
Mike Buess Origin WebRing Member
Edited by - Mike Buess on 07/27/2004 3:22:52 PM |
Piasecki |
Posted - 07/27/2004 : 1:59:46 PM In fact I might copy the time stamp into the window name, right? E.
|
Piasecki |
Posted - 07/27/2004 : 1:19:53 PM OK, so this is equivalent to giving (by hand)different name for each figure (window), but this name will be printed and afterwards can be found via the FIND dialog, right? Eryk
|
Mike Buess |
Posted - 07/27/2004 : 1:01:18 PM I explained how to add the figure (window) name to the stamp label. Once you know that you can use Project Explorers Find feature to bring it up. Or simply enter this command in the script window...
win -a WindowName;
Mike Buess Origin WebRing Member
Edited by - Mike Buess on 07/27/2004 1:20:19 PM |
Piasecki |
Posted - 07/27/2004 : 12:58:02 PM This might be a solution for the future if not the fact that in a project I have usually about 100 figures, so how I can find between them THE figure??? Or perhaps I misunderstood you? Eryk
|
Mike Buess |
Posted - 07/27/2004 : 12:35:19 PM I can't think of a way to identify the project from which an existing printout was made but you can avoid the problem in the future. Just download and install stamp.opk from OriginLab's File Exchange...
http://www.originlab.com/FileExchange/details.aspx?C=5&cid=5&fid=27
It installs a toolbar button that labels the graph with the path and name of the project. (That label does print with the graph.) Be sure to save the project first or you'll end up with a label that says UNTITLED. It's even easy to add the window name to the stamp label. Open Stamp.ogs in Notepad and change the one-line script to this...
label -s -sa -d (.1*page.width) (.05*page.height) -n pathstamp \v(%x%g - %H);
Mike Buess Origin WebRing Member
Edited by - Mike Buess on 07/27/2004 12:52:42 PM |
Piasecki |
Posted - 07/27/2004 : 12:07:34 PM Thanks a lot, Mike, but... perhaps I should start from explanation why I need the feature. After one or 2 years of making figures I have a pile of them printed out. If I find between them something interesting which I would like to use or edit, I have to dig into thousands of Origin Figs. To make this task easier I should have each (printed)figure (easily) marked in a way that after some time I can rapidly find it in my project(s). I was thinking about the time stamp, but if it is difficult or impossible, perhaps there is some other easy (automatic?) way of labeling every figure in a way making possible finding the figure afterwards? The axis labels are not very practical because they are usually similar or the same in many figures. Giving the separate label to every figure is difficult, besides the labels are (apparently) not printed. Nor the number of graph. Perhaps you have any idea? Thanks in advance Eryk
|
Mike Buess |
Posted - 07/27/2004 : 11:32:24 AM 1. Just copy/paste the script to the [Main] section. Should end up looking like this (the script that was already there is commented out)...
[Main] // type -b $General.Userbutton; %L="search string"; getn (axis label text) %%L (Find...); doc -e P { %A=xb.text$; if("%A"=="%L") win -a %H; };
2. Origin doesn't keep track of window creation dates or times (at least that information cannot be accessed from LabTalk). However, the doc -e P command loops through all graph windows in the order they were created and applies the bracketed script to each. The script I've already given you activates a window based on its X axis label. Alternatively, you could activate the window based on creation order...
nn=1; // default to first window getn (window number) nn (Find...); mm=0; doc -e P { mm++; // increment mm if(mm==nn) win -a %H; }
If that's satisfactory I can show you how to combine the label text and creation order scripts.
Mike Buess Origin WebRing Member
Edited by - Mike Buess on 07/27/2004 11:35:36 AM |
Piasecki |
Posted - 07/27/2004 : 10:29:50 AM Thanks a lot, but... 1. Is it a sketch or I should copy it literally? (I have no idea about C nor LabTalk. 2. I think that the time stamp is most frequently used to identify the Graph. There is no way to search according to it? Best regards Eryk
|
Mike Buess |
Posted - 07/27/2004 : 10:19:38 AM You'll have to write your own script for that and in Origin 6.1 it will have to use LabTalk. Time stamp will not be possible. To search for axis label text you might try something like this...
%L="search string"; getn (axis label text) %%L (Find...); doc -e P { %A=xb.text$; if("%A"=="%L") win -a %H; };
Open custom.ogs (Origin's program folder) in Notepad and copy/paste that script to the [Main] section. Save and try it out by clicking the Custom Routine button on the Standard toolbar. It will look at the bottom X axis label in the active layer of each graph in the project. If the text matches the search string then it will activate that graph window.
Hope that helps,
Mike Buess Origin WebRing Member |
Piasecki |
Posted - 07/27/2004 : 09:12:48 AM Hi, That's the point! My question was/is: how to find a graph knowing some string (time stamp, title, label on the axis etc). I think that what Greg proposed is not a solution. Is there any better? Eryk PS. I have Origin 6.1
|
Mike Buess |
Posted - 07/27/2004 : 06:58:24 AM Hi Eryk,
Time stamp and axis text are not choices in my Find dialog. (Origin 7.5) The Search in options that I see are Window Names, Window Labels and Folder Names. What version of Origin are you using?
Mike Buess Origin WebRing Member |