Author |
Topic  |
|
tib
Switzerland
105 Posts |
Posted - 03/05/2003 : 05:52:02 AM
|
Hi, is there a possibility to read back an object name? It's possible to read the text, e.g. like a button with %A=this.text$; type The text on this button is %A;
I was looking for something like: %A=this.name$; type You pressed on %A; but it seems not to be possible. But is there a way? Thanks, Tilman.
|
|
Laurie
USA
404 Posts |
Posted - 03/12/2003 : 10:32:22 AM
|
object.name$ will set the object name but you can not Read it back. Maybe you can explain why you need this and we can think of a work around method.
OriginLab Technical Support |
 |
|
rlewis
Canada
253 Posts |
Posted - 03/13/2003 : 1:44:33 PM
|
If you are running Origin 7, you can use OriginC ... The following example was lifted from the Help-Programming section
// For this example to run, a graph window with the name "Graph1" must exist in the project. void run_GraphObject_GetName() { // Create and attach a graph layer from "Graph1": GraphLayer gl("Graph1"); GraphObject grobj; // Loop over all the graphic objects in the layer and for each of them // display its name: foreach (grobj in gl.GraphObjects) { out_str(grobj.GetName()); } }
|
 |
|
marko
Germany
112 Posts |
Posted - 03/17/2003 : 05:06:57 AM
|
Well, and what to do in Origin 6.1 Pro? Marko
|
 |
|
roland.som
Switzerland
9 Posts |
Posted - 10/03/2005 : 04:02:53 AM
|
I have the same problem than tib, I need to get the object name.
I created a vertical line on a graph window using the draw command and then I wrote a script in the label control window, which redraws the line at a given position each time the user moves the line (Script, run after "Moved"). The problem is that I can not set the new x position with the "this.x" property, it just does not work. I have to use the "draw -n ObjectName -l -v NewX" command, and for this, I need the object name.
If I have more than one of those vertical lines, I would have to modify the script of each object manually...
Any suggestions about how to redraw the line without knowing its name?
Thanks, Roland
|
 |
|
Mike Buess
USA
3037 Posts |
Posted - 10/03/2005 : 07:06:02 AM
|
Hi Roland,
It seems like you already have one solution... name the line yourself by creating it with draw -n MyLine. Another solution is to select the object with the mouse and use the labtalk command select -g O to assign its name to the string variable %O.
Mike Buess Origin WebRing Member |
 |
|
|
Topic  |
|