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
 LabTalk Forum
 relabeling windows...
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

hborck

USA
20 Posts

Posted - 10/12/2001 :  10:50:21 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Is there a way to rename windows outside the

win -r windowName newName;

methodology? For example, In a script I make several graphs automatically, which are naturally labeled by Origin as Graph1, Graph2, etc...

I do NOT want to hardwire in what Names to give each individual graph, i.e.:

win -r graph1 new_name1;
win -r graph2 new_name2;
etc...

But would rather be able to just change it on the fly. As in:

win -a graph1;
something to change name of window;

Is there an object maybe for this which can be manipulated? I do not see one in the manual...

Thanks,

hborck

Mike Buess

USA
3037 Posts

Posted - 10/12/2001 :  11:29:34 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Why not name the graphs when you create them?
win -t P template windowname ;
That opens a plot window from the template template and names it windowname. You can use the GetEnumWin macro to determine windowname in advance. (See the Predefined System Macros section in LabTalk help.)

Mike Buess
Origin WebRing Member
Go to Top of Page

hborck

USA
20 Posts

Posted - 10/12/2001 :  12:10:48 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
For one reason or another I do not use the win-t method to make the graphs.

I use:
work -p 202;

see my other thread "graphing many columns of data" for a rather long discussion...

an edited version of the script (basic flow) is below:

***********************************
//select the spreadsheet
win -a ABSdata1;
//start the loop here

For(jkl=2; jkl<=5; jkl=jkl+2)
{

//choose the 1st column as X values, and the second as Y values
wks.col$(jkl-1).type=4;
wks.col$(jkl).type=1;

//grab the data for labeling of the graph
%A=wcol(jkl-1)[3]$;
%J=wcol(jkl-1)[1]$;
%K=wcol(jkl-1)[2]$;

//Now lets make a graph

win -a ABSdata1;
work -s $(jkl-1) 5 $(jkl) 468;
work -p 202;

//now we need to correct the labels on the graphs
label -n YL Reflectivity;
label -n XB ABS;
label -r legend;
label -s -d 1200 150 %J;
label -s -d 1200 220 %K;
label -s -d 1200 290 %A;
//next, rename the graph

win -a ABSdata1;
}
***********************************

if you replace the loop control value with wks.ncols, the loop would make MANY graphs. at the end of the loop, where I begin to relabel the graph in question I cannot change the title without referring to the current name of the window, which ranges from Graph1 to Graph###...

------------hborck
Go to Top of Page

Mike Buess

USA
3037 Posts

Posted - 10/12/2001 :  1:22:53 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
You want to rename Graphxx as new_namexx? %H always holds the name of the active window, so you can do that with substring notation like this...
win -r %H new_name%[%H,>6];
%[%H,>6] picks out the substring of %H beginning with the 6th character and ending with the last character.

Mike Buess
Origin WebRing Member
Go to Top of Page

hborck

USA
20 Posts

Posted - 10/19/2001 :  10:49:20 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Sorry, I have been busy. I will give this a whirl and get back to you.

Thanks for the help again.

---------------hborck


quote:

You want to rename Graphxx as new_namexx? %H always holds the name of the active window, so you can do that with substring notation like this...
win -r %H new_name%[%H,>6];
%[%H,>6] picks out the substring of %H beginning with the 6th character and ending with the last character.

Mike Buess
Origin WebRing Member

Go to Top of Page

hborck

USA
20 Posts

Posted - 10/19/2001 :  11:38:05 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thanks, that worked!

I just ran the script for the first time through all columns. 800+ graphs created in about 20 minutes. I am surprised windows 98 survived that. I thought for sure the machine would blow up.

--------------hborck
Go to Top of Page

CStorey

Canada
137 Posts

Posted - 10/19/2001 :  12:05:31 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Wow 800 graphs! I created an add-on tool called SlideShow/FilpShow to manage my large projects (~100 graphs) that would probably help you out even more! It's in the Add-On modules forum.

Craig Storey
Origin WebRing Member - http://nav.webring.yahoo.com/hub?ring=originwebring
Go to Top of Page

Mike Buess

USA
3037 Posts

Posted - 10/19/2001 :  1:09:45 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
I'm impressed, too! I understand now why you put so much effort into automating this. Are you sure you have enough space on your hard drive to save the project file?

Glad you got it to work.

Mike Buess
Origin WebRing Member
Go to Top of Page

hborck

USA
20 Posts

Posted - 10/19/2001 :  1:43:14 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
I will check it out. Sounds very useful.

Thanks again both.
-----------------hborck

quote:

Wow 800 graphs! I created an add-on tool called SlideShow/FilpShow to manage my large projects (~100 graphs) that would probably help you out even more! It's in the Add-On modules forum.

Craig Storey
Origin WebRing Member - http://nav.webring.yahoo.com/hub?ring=originwebring

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