Author |
Topic  |
|
cjfraz
USA
22 Posts |
Posted - 11/13/2006 : 9:33:08 PM
|
Two questions:
1 – once I’ve created a custom graph template and saved it as an OTP file, what is the easiest and most efficient way (in O75Pro) to create a toolbar button that will automatically plot *highlighted data in the active worksheet* to this template?
2 – How can I rearrange the order of the categories in the main ‘Template Library’? I don’t really want to delete all the entries in there, but I’d like to have ‘My Templates right at the top.
Thanks very much for any advice.
J…
|
|
Mike Buess
USA
3037 Posts |
Posted - 11/13/2006 : 10:53:18 PM
|
1. The button should run the following LabTalk script...
worksheet -p plotID TemplateName; Legend; // create legend
See the -p option of the Worksheet command for a list of plotID's... plotID=200 (line), 201 (symbol), 202 (line+symbol), etc. See Help > Origin > Setting Your Preferences > Customizing Toolbars for instructions on creating toolbars.
2. Template Library settings are saved in Template.ini on your User path. Move your template category (e.g., 8=My Templates) to the top of the Categories list but after the count=8 key. No need to renumber the categories.
Mike Buess Origin WebRing Member |
 |
|
cjfraz
USA
22 Posts |
Posted - 11/14/2006 : 12:14:21 AM
|
Hi Mike,
Solution 2 works like a charm. Thank you.
As for solution 1… that seems to work fine as long as the template has only one layer, however, it does not work so well with more complicated templates.
Any idea how to do this if the template has two or more layers?
Imagine for example that the active worksheet has X2-Y2-Y2 selected, and the intent is to click a button and plot each selected curve into its own layer in a specific template?
I thought (hoped) there might be a way to do this with minimal coding because the same template that fails the worksheet –p command works ok if you just select the data on the worksheet, and plot to the template via the ‘My Templates’ category in the template library. Thanks,
J…
Edited by - cjfraz on 11/14/2006 12:15:57 AM |
 |
|
Mike Buess
USA
3037 Posts |
Posted - 11/14/2006 : 08:44:26 AM
|
Two or more layers complicates the script considerably. (Plot button on the Template Library dialog does not use worksheet -p.) This might work for a 2-layer graph (2 Y-columns selected)...
nn=0; %P=""; %Q=""; loop(i,1,wks.ncols) { if(wks.IsColSel(i) && wks.col$(i).type==1) { if( nn ) {%Q=%(%H,i); break}; else {%P=%(%H,i); nn=1}; }; }; win -t P TemplateName; layer -s 1; layer -iPlotID %P; layer -s 2; layer -iPlotID %Q;
Mike Buess Origin WebRing Member |
 |
|
|
Topic  |
|
|
|