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
 replace text objects in both layers of the graph
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

ytyyutianyun

48 Posts

Posted - 02/14/2014 :  8:25:53 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. 8.6 and Service Release 3(Select Help-->About Origin):
Operating System: windows 7

I use the code:
doc -e P {
TEXT.TEXT$ = "x/L=1 v=1m/s";
}


It only replace the text in the 1st layer of the graph. How can I replace the text in the 2nd layer of the graph. Thanks






Edited by - ytyyutianyun on 02/14/2014 8:28:01 PM

lkb0221

China
497 Posts

Posted - 02/17/2014 :  09:45:54 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

That is because these two text objects are in the different layers and both name is "text".
"doc -e P" loop is just activate graph windows and run the script, it will not operate in each of the graph layers automatically.

So you can use "page.active" to switch layers and run "text.text$" again during each loop.
Or, use "doc -e LP" to replace "doc -e P". This will execute the script for all layers in all graph windows and Layout windows (only) in the project.

Zheng
OriginLab

Edited by - lkb0221 on 02/17/2014 1:25:55 PM
Go to Top of Page

ytyyutianyun

48 Posts

Posted - 02/17/2014 :  8:37:49 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
quote:
Originally posted by lkb0221

Hi,

That is because these two text objects are in the different layers and both name is "text".
"doc -e P" loop is just activate graph windows and run the script, it will not operate in each of the graph layers automatically.

So you can use "page.active" to switch layers and run "text.text$" again during each loop.
Or, use "doc -e LP" to replace "doc -e P". This will execute the script for all layers in all graph windows and Layout windows (only) in the project.

Zheng
OriginLab



Thanks, both solutions are well and solve my question, Thanks.
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