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
 Setting the 'substitution level' via labtalk?
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

johannes.kastl

Germany
71 Posts

Posted - 08/01/2012 :  08:06:25 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hi everyone,

is it possible to set the 'substitution level' for an existing label via labtalk? I only found ways to do this while creating a label, not when modifying an existing one.

'Substitution level' is available via right-click, then programming control, and then setting 'Link to (%, $), Substituion' to 1, 2,... This was called differently in older versions of Origin.

Origin Ver. and Service Release (Select Help-->About Origin): 8.6.0G SR3, Operating System: Windows XP

Regards,
Johannes

greg

USA
1378 Posts

Posted - 08/01/2012 :  4:24:04 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
I couldn't find a LabTalk means of doing this, but here is an OriginC function you can use:

void SetLevel(string strObj, int iLevel)
{
GraphLayer gl= Project.ActiveLayer();
if(gl.IsValid())
{
GraphObject go = gl.GraphObjects(strObj);
if(go.IsValid())
{
if(go.GetObjectType() == "Text")
{
Tree tr;
BOOL bRelative = TRUE;
tr = go.GetFormat(FPB_ALL, FOB_ALL, TRUE, bRelative);
tr.Root.LinkToVars.nVal = iLevel;
go.ApplyFormat(tr, TRUE, bRelative);
}
else
printf("%s is not a Text object.\n", strObj);
}
else
printf("%s is not a valid object in active layer\n",strObj);
}
else
printf("GraphLayer not active.\n");
}

For example, with a graph active and a layer with the Legend active, you can shut off substitution with:
SetLevel(Legend,0)
and turn it back on with
SetLevel(Legend,1)

Edited by - greg on 08/01/2012 4:27:05 PM
Go to Top of Page

johannes.kastl

Germany
71 Posts

Posted - 08/02/2012 :  04:47:22 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thanks a lot, it works.

BTW, is there a document describing the use of the different substitution levels? 0=off, 1=on, 2=? ?

Regards,
Johannes
Go to Top of Page

AKazak

Russia
1205 Posts

Posted - 06/06/2022 :  06:42:44 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
quote:
Originally posted by johannes.kastl

Thanks a lot, it works.

BTW, is there a document describing the use of the different substitution levels? 0=off, 1=on, 2=? ?

Regards,
Johannes



Here it is: https://www.originlab.com/doc/en/Origin-Help/Ob-Prop-Program-tab#The_Link_to_.28.25.2C.24.29.2C_Substitution_Level_Drop-down_List

---
Andrey
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