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
 "dynamik" reference & file name reference
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

Cracker

6 Posts

Posted - 10/09/2022 :  12:40:38 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. and Service Release: OriginPro 2021 (64-bit), 9.8.0.200
Operating System: Windows 10 Home, 64-Bit-Betriebssystem

Dear forum members,
this question bugged me for a long time, but I never knew how to express my problem. I hope the following (and rather lengthy) explanation can provide enough input.

The following example shows how I usually use Origin:
After creating a project file I create some sup files to organize the rawdata, the calculation, the results and remarks.

The data I need to analyze consists of a series of test with changing parameters. So, I create a sup file and a template by analyzing the first test.
I save this template as a new project, add it again and change the file name (xx -> Test_02) and overwrite the raw data. The goal is to "automatically" create all the necessary graphs and calculations.

Now my problem:

1) Inserting Links: For example the references "var: //[L_Z1] 1! VLINE2.X" does not work anymore as intended, because the names of the added sheets get an "A" at the end. Would I add the template again all the sheets get a "B" and so on.
-> Is there a solution to this problem?

2) Is it possible to reference a file name? Example: If I change the file name (xx- Test_02) the title of the graph should also change.



Cheers
Cracker

Echo_Chu

China
Posts

Posted - 10/10/2022 :  02:49:42 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi, Cracker

You can try embedded your graph in the "Results" Worksheet as the second sheet. Then you can write the reference as "var://[%(2!col(A)[C]$)]1!vline.x1" to avoid windows name in the reference.



Echo
OriginLab Technical Service
Go to Top of Page

Cracker

6 Posts

Posted - 10/10/2022 :  04:37:39 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thanks for this neat work around!

I am fairly new to Origin and I do not have any programming background, so sometimes it is difficult to really understand the given solutions.

Regarding "var://[%(2!col(A)[C]$)]1!vline.x1" for example
1) var://[%( )]
-> I think I get this https://www.originlab.com/doc/en/LabTalk/guide/Substitution-Notation#.25.28_.29_Substitution

2)(2!col(A)[C]$)
-> this is confusing to me. "2!" references the second sheet in the given window (so where the graph is). But what is "col(A)[C]", or to be more specific, what does it reference? I only see the graph and no columns or rows ;)


Based on your answer it seems there is no direct solution. Origin does automatically change the windows names (Windows1 -> Window1A), but does not do so with the references inside the added project file.

"avoid windows name in the reference" is the goal (solution) here.
Go to Top of Page

snowli

USA
1429 Posts

Posted - 10/10/2022 :  11:02:49 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Cracker,

Col(A)[C] refers to column A's comments label row.

When you add graph as a sheet in workbook, we actually put the graph in a worksheet with only 1 column and one row so it's column A. [1] row.
The graph window name on the top, which is actually the comments row of the column.


If u right click the whole window title. E.g. Book1 and
choose View: Column header context menu to turn on column header.
Also choose View: Row header context menu to turn on Row header.

U will be able to see the column and row info. e.g. A(X) and Comments, 1

We hide it for such graph sheet so it's nicer looking.

Since Col(A)[c] is filled with graph window, if u use it in code, it will always refer to correct graph window.


Thanks, Snow
Go to Top of Page

cpyang

USA
1406 Posts

Posted - 10/10/2022 :  2:20:43 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Actually the col(A)[C] namely Comment cell does not hold the graph name, but "str://%@T" and %@T is a string register that points to the graph's name in the sheet. You can double-click to see and change it. It will not work if your graph has a long name. See

https://www.originlab.com/doc/LabTalk/guide/String-registers#:~:text=String%20registers%20hold%20up%20to,are%20also%20known%20as%20%25%20variables.

We can make a change to use graph long name, and to find in current folder first. Currently if the name is quoted, it will be interpreted as searching by long name, which does not change upon appending, but it will not favor current folder.

I added ORG-25804 for this and should be in the upcoming Origin 2023.

CP
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