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
 Access different layers from command window
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

bur2000

Germany
36 Posts

Posted - 02/25/2014 :  10:20:57 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. and Service Release (Select Help-->About Origin): 9

I want to place some text elements at the same scalar position in different layers. However, from the command window I can only access any element in the currently active layer:

Text1.x=100
Text2.x=100
#Command Error!


Is there any way to access a text object in layer 2 without having to activate it first?

Castiel

343 Posts

Posted - 02/25/2014 :  10:55:54 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
It's gobject.For example,
gobject go1=[graph1]1!text1;
gobject go2=[graph1]2!text2;
go1.x=100;
go2.x=100;


妾+   午旦  妹罕妾  妾伊    用仇  妾/     岫ㄞ
 妾京用 仍巨  件 侈   件戶' 甘岫平   /欠  白岫妹
   併             艮          岫  奈 白   岫
                              岫
Go to Top of Page

bur2000

Germany
36 Posts

Posted - 02/26/2014 :  07:21:40 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thanks a lot.

It seems like
[Graph1]1!Text1.x=

doesn't work. I have to assign it to a variable first?
Go to Top of Page

Castiel

343 Posts

Posted - 02/26/2014 :  08:14:05 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
quote:
Originally posted by bur2000

Thanks a lot.

It seems like
[Graph1]1!Text1.x=

doesn't work. I have to assign it to a variable first?



Such syntactic sugar of course tastes good. But right now, think about an object's name that consists of a dot, say, "Text1.x". How can one tell you expect the property "x" of "Text1", or just the object "Text1.x"?
On the other hand, you make me think of the with...end with statement in other programming language, i.e.

with object
    .property1 = p1
    .property2 = p2
    ....
end with


妾+   午旦  妹罕妾  妾伊    用仇  妾/     岫ㄞ
 妾京用 仍巨  件 侈   件戶' 甘岫平   /欠  白岫妹
   併             艮          岫  奈 白   岫
                              岫
Go to Top of Page

bur2000

Germany
36 Posts

Posted - 02/26/2014 :  09:15:47 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
I know what you mean and that normally you have to instantciate a text to access it. But when Layer 1 is active, the simple statement

Text1.x=200
works. But

[Graph1]1!Text1.x=200
does not work.

I guess it's just how Origin does it.

Edited by - bur2000 on 02/26/2014 09:16:53 AM
Go to Top of Page

Castiel

343 Posts

Posted - 02/26/2014 :  10:18:10 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
quote:
Originally posted by bur2000

I know what you mean and that normally you have to instantciate a text to access it. But when Layer 1 is active, the simple statement

Text1.x=200
works. But

[Graph1]1!Text1.x=200
does not work.

I guess it's just how Origin does it.



I did not realize that case. But it fails if the three objects are named "a", "a.x", "a.x.x", while gobject works. Anyway, who would name an object in that way....

妾+   午旦  妹罕妾  妾伊    用仇  妾/     岫ㄞ
 妾京用 仍巨  件 侈   件戶' 甘岫平   /欠  白岫妹
   併             艮          岫  奈 白   岫
                              岫
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