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
 Origin Forum
 Rename graphs with the worksheet name
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

surjpanj

Canada
18 Posts

Posted - 12/04/2020 :  09:38:18 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. and Service Release (Select Help-->About Origin): 2016
Operating System: Windows

Hi,

I have five worksheets each with different name. From data in each worksheet I then plot ten different graphs (together I get 50 graphs named Grpah1....Graph50).
I want to write a script that would rename each graph with the name of the worksheet and add a number to each sequential graph (e.g. G_Book01_01, G_Book01_02, G_Book01_03... then for the next ten graphs: G_Book02_01, G_Book02_02, G_Book02_03..., etc. for the rest of worksheets and graphs).
Any idea how to do this?

Thanks,
Matt

YimingChen

1649 Posts

Posted - 12/04/2020 :  2:47:41 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Can you try the LT script:

int numPlot = 1;
doc -e LP{
	range -w rG = %C;
	string strRange$ = %(rG);
	page.LONGName$ =  strRange$;	
}


James

Edited by - YimingChen on 12/04/2020 2:47:59 PM
Go to Top of Page

surjpanj

Canada
18 Posts

Posted - 12/05/2020 :  10:28:46 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi James,

it works but it gives me too much data in the names. The graph names are composed as [workbook short name][workbook long name][!column][column long name]. I would like simpler and shorter naming: [workbook long name][two digit number] (e.g. Book1_01, Book1_02, Book1_03... Book2_01, Book2_02, Book2_03...)

Thanks,
Matt
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