Author |
Topic |
|
johannes.kastl
Germany
71 Posts |
Posted - 08/01/2012 : 08:06:25 AM
|
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
|
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 |
|
|
johannes.kastl
Germany
71 Posts |
Posted - 08/02/2012 : 04:47:22 AM
|
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 |
|
|
AKazak
Russia
1205 Posts |
|
|
Topic |
|
|
|